Forum Discussion

Rodney2485's avatar
Rodney2485
Brass Contributor
Oct 05, 2024
Solved

Listing and counting unique values that match criteria

I want to create a list off another list but i'm having some issues getting things the way I want.

 

The "All Task" is the list i'm pulling data from.  I want to grab each unique Wave Number and then show each unique task along with type and an overall count per type.

  • Rodney2485 

    You have a few options here. I'd go with GROUPBY because it will allow you to apply multiple functions to the data. You may have to change the arrangement, but it handles this task well.

    =LET(
        row_field, Tasks[Wave '#],
        f, row_field = rpt_filter,
        values, HSTACK(Tasks[Task '#], Tasks[Task '#], Tasks[Task Status]),
        fn, HSTACK(COUNTA, ARRAYTOTEXT, ARRAYTOTEXT),
        agg, GROUPBY(row_field, values, fn, , 0, , f),
        DROP(agg, 1)
    )

16 Replies

  • peiyezhu's avatar
    peiyezhu
    Bronze Contributor

    Rodney2485 

     

    SQL:

     

    select * from AllTasks limit 5;

    select f02 as 'Insert Wave Number Here

    ',group_concat(distinct(f04)),count(distinct(f04)),f05,f07 from AllTasks group by f02;

     

     

     

    f01 f02 f03 f04 f05 f06 f07 f08 f09

    0702024100403870 WMAL WALMART1116144168Replen CASE-ROP4000-Available120241004
    0702024100403970 WMAL WALMART1116144178Replen CASE-ROP4000-Available120241004
    0702024100406570 WMAL WALMART1116144371Case Pick4000-Available120241004
    0702024100405270 WMAL WALMART1116144293Replen CASE-ROP4000-Available120241004
    0702024100405270 WMAL WALMART1116144294Replen CASE-ROP5000-Available120241004

    Insert Wave Number Here group_concat(distinct(f04)) count(distinct(f04)) f05 f07

    2024100403211161441241Replen CASE-ROP15-Held
    2024100403311161441391Case Pick15-Held
    2024100403411161441431Replen CASE-ROP20-Being Pulled
    2024100403811161441681Replen CASE-ROP00-Available
    2024100403911161441781Replen CASE-ROP00-Available
    2024100404011161441831Less Than Full Pallet Replen CASE - RRC20-Being Pulled
    2024100404111161441991Less Than Full Pallet Replen CASE - RRC15-Held
    202410040421116144208,11161442132Replen CASE-ROP20-Being Pulled
    2024100404311161442201Replen CASE-ROP15-Held
    202410040441116144251,11161442482Replen CASE-ROP10-Prt/Assigned
    2024100404611161442631Case Pick10-Prt/Assigned
    2024100404711161442651Less Than Full Pallet Replen CASE - RRC15-Held
    2024100404811161442691Replen CASE-ROP20-Being Pulled
    202410040521116144293,1116144294,1116144295,11161442894Replen CASE-ROP00-Available
    2024100405311161443011Case Pick20-Being Pulled
    202410040561116144310,11161443152Less Than Full Pallet Replen CASE - RRC10-Prt/Assigned
    2024100405811161443251Replen CASE-ROP15-Held
    202410040591116144335,11161443362Replen CASE-ROP20-Being Pulled
    2024100406011161443391Case Pick15-Held
    2024100406111161443411Less Than Full Pallet Replen CASE - RRC00-Available
    202410040621116144350,11161443492Replen CASE-ROP10-Prt/Assigned
    2024100406411161443631Case Pick15-Held
    2024100406511161443711Case Pick00-Available
    202410040661116144396,1116144395,11161443983Replen CASE-ROP00-Available
    2024100406711161444061Case Pick15-Held
    2024100407011161444211Less Than Full Pallet Replen CASE - RRC20-Being Pulled
    202410040721116144438,11161444372Case Pick10-Prt/Assigned
  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    Rodney2485 

    You have a few options here. I'd go with GROUPBY because it will allow you to apply multiple functions to the data. You may have to change the arrangement, but it handles this task well.

    =LET(
        row_field, Tasks[Wave '#],
        f, row_field = rpt_filter,
        values, HSTACK(Tasks[Task '#], Tasks[Task '#], Tasks[Task Status]),
        fn, HSTACK(COUNTA, ARRAYTOTEXT, ARRAYTOTEXT),
        agg, GROUPBY(row_field, values, fn, , 0, , f),
        DROP(agg, 1)
    )
    • Rodney2485's avatar
      Rodney2485
      Brass Contributor
      When I click into the formula it stops working, and honestly my excel knowledge is too limited to figure out how to duplicate this.
      • Lorenzo's avatar
        Lorenzo
        Silver Contributor

        Rodney2485 

         

        #1 When I click into the formula it stops working

        What does this actually mean/What happens?

         

        #2 and honestly my excel knowledge is too limited to figure out how to duplicate this

        - Fair enough. Looking at your previous posts you seem to run Excel 365. Please confirm or tell us which version you run + Windows or Mac?

        - Assuming you run 365, if in a blank sheet you start typing: =gr do you see?:

        the problem might be that you don't have the GROUPBY function (365 only and not Generally Available yet)

Resources