Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

How to group the multiple column values that result need to be place in one row.

Gmurugan
7 - Meteor

Hi ,

 

I have the usecase to group multiple column value with certain condition. Below is the scenario

Under CLX category, i need only LAX city ( green) to show but Sum_F should be 35 (need to sum all sum_F- CLX value (13+1+0+21)). Other rows and columns  should present as it is. Grouping required only Sum_F not all . Red row not required.

 

This grouping required only CLX category not for PNW/OAK. Please any suggestion to achieve this use case

 

 

Capture3.PNG

Thanks 

Geetha

 

6 REPLIES 6
acarter881
12 - Quasar

Hello, @Gmurugan.

 

It seems like you can use the Summarize tool to group by category and sum "Sum_F" then use the Filter tool on your original dataset to exclude cities that are not equal to "LAX" with a category of "CLX" then use a Join tool on the summarized total and your filtered data. You may need to define some grouping for your dates as well, such as adding a new field that includes the month and including that in your grouping within the Summarize tool.

Gmurugan
7 - Meteor

Hi  @acarter881 ,

 

 I tried with Summarize tool but facing issue when am trying to exclude the red row. Am not sure what I missed. can you please provide some workflow, it will help me to understand better.

 

thank you!

flying008
14 - Magnetar

Hi, @Gmurugan 

 

FYI.

录制_2023_07_13_14_58_13_411.gif

 

Input            
DateCategoryCityNext codenumberSum_ASum_BSUM_CSum_DSum_ESum_F 
2023-3-21PNW/OAKTACHONabc4813053811400 
2023-3-21PNW/OAKOAKHONabc48133369254500 
2023-3-21PNW/OAK TOTAL  abc481638107364900 
2023-4-4PNW/OAKTACHONabc482315368900 
2023-4-4PNW/OAKOAKHONabc48231775263400 
2023-4-4PNW/OAK TOTAL  abc482632111344300 
2023-5-17CLXSHA HON abc48311000013 
2023-5-17CLXNAH HON abc483100001 
2023-5-17CLXLAX HON abc483690234215000 
2023-5-17CLXGUM HON abc4834000021 
2023-5-17CLX TOTAL  abc4837062342150035 
2023-8-9CLXGUMNAHabc4858000020 
2023-8-12CLXNAHNGBabc485200006 
2023-8-16CLXSHALAXabc48522000027 
2023-8-30CLXLAXHONabc485703171176611 
2023-8-30CLX TOTAL  abc4857351711766154 
             
Output            
DateCategoryCityNext codenumberSum_ASum_BSUM_CSum_DSum_ESum_FSum_DF
2023-3-21PNW/OAKTACHONabc4813053811400 
2023-3-21PNW/OAKOAKHONabc48133369254500 
2023-3-21PNW/OAK TOTAL  abc481638107364900 
2023-4-4PNW/OAKTACHONabc482315368900 
2023-4-4PNW/OAKOAKHONabc48231775263400 
2023-4-4PNW/OAK TOTAL  abc482632111344300 
2023-5-17CLXSHA HON abc48311000013 
2023-5-17CLXNAH HON abc483100001 
2023-5-17CLXLAX HON abc48369023421500035
2023-5-17CLXGUM HON abc4834000021 
2023-5-17CLX TOTAL  abc4837062342150035 
2023-8-9CLXGUMNAHabc4858000020 
2023-8-12CLXNAHNGBabc485200006 
2023-8-16CLXSHALAXabc48522000027 
2023-8-30CLXLAXHONabc48570317117661154
2023-8-30CLX TOTAL  abc4857351711766154 

 

AnnaMikhaylova
8 - Asteroid

Hi @Gmurugan 

 

If you first filter out all the TOTAL rows, then use summarise tool (but without grouping by City or Next) you will calculate Totals. You then can isolate using Formula tool your total CLX result and use them both as CLX line item and total. You then will need to filter existing CLX data from your data set and union both CLX as Totals and as LAX back. Then you can use Union tool to join newly calculated totals to your filtered data (just pay attention to the column names, so it unions by Name correctly, and then a small trick of using summarise tool again to get the rows in correct order. I attached a possible solution.

 

Spoiler
 
Capture.JPG

Gmurugan
7 - Meteor

I understand now, this is great! . Thank you so much

AnnaMikhaylova
8 - Asteroid

Hi @Gmurugan, if the response works for you, could you, please, mark it as a solution. Thank you.

Labels