Alteryx Designer Desktop Discussions

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

Dynamic Group By

Balajiprasad
7 - Meteor

Hi,

I have a workflow with a summarize tool. I am performing Group By operation for two fields and sum operation for one field.

 

Now I need to add two more fields in Group By category and perform the same operation. How to achieve this dynamically?

 

Thanks!

 

 

5 REPLIES 5
ponraj
13 - Pulsar

Possible to share sample data and desired output ? 

Balajiprasad
7 - Meteor

Sure @ponraj . The sample data and desired output looks something like the below. My group by fields are Country and Year and Salary should be the sum.

 

CountryYearSalary Output:  
IND201110000 CountryYearSalary
IND201110000 IND201130000
IND201110000 IND201235000
IND201215000    
IND 201220000    

 

May be tomorrow i can have two more group by fields Department and Position like the below.

 

CountryYearDepartmentPositionSalary Output:    
IND2011ITManager12000 CountryYearDepartmentPositionSalary
IND2011ITManager13000 IND2011ITManager25000
IND2011ITAssociate10000 IND2011ITAssociate10000
IND2012ADMINTL15000 IND2012ADMINTL15000
IND 2012ADMINMN20000 IND 2012ADMINMN20000

 

I don't want to create one more Summarize tool to do this. Instead I want to do this dynamically. Is it possible?

BenMoss
ACE Emeritus
ACE Emeritus

The only way I see this being dynamic is if you want the logic to be like 'group by every field apart from the salary field which you sum', this is possible, and I have provided an example for you (Y)

 

2019-03-07_07-19-28.png

ponraj
13 - Pulsar

@Balajiprasad, Attaching a sample workflow.  Hope this is helpful.

 

Dynamic Group By.PNG

Balajiprasad
7 - Meteor

Thanks @ponraj this is exactly what i want. But can we do this using Macro and Control Parameters?

Labels