Hi All,
I have input in the below format. Now since this is a quarterly process, My headers will keep changing according to months in the quarter as shown below.
Input for Q1 | ||
Mar | Apr | May |
200 | 300 | 400 |
Output required:
Mar | Apr | May | Sum |
200 | 300 | 400 | 900 |
Now in the second quarter the headers will change as shown below. How do I do this dynamically using formula tool or any other tools available. Hope I'm clear with the requirement. Appreciate any help.
Input for Q2 | ||
Jun | Jul | Aug |
600 | 700 | 800 |
Solved! Go to Solution.
Hi @hemant86 one approach would be to pivot your data and then sum up the values. I have attached an example of that approach.
You can flip the data vertically using a Transpose Tool , do your sum with a Summarize Tool , then flip it back to horizontal with a Crosstab Tool . The links are to the Tool Mastery Index , which is a great resource to learn tools. Also, in Alteryx itself, if you click the icons for the tool in the top palate, you'll see "Open Example" that you can click for each tool as well:
Play around with it and let us know if you have any trouble or need further assistance.
Thanks @JosephSerpis . Sorry I was not clear enough with my requirement. The requirement is as below
Input Q1
Empid | Mar | Apr | May |
1 | 200 | 300 | 400 |
2 | 100 | 200 | 500 |
3 | 600 | 100 | 200 |
Output
Empid | Mar | Apr | May | Total |
1 | 200 | 300 | 400 | 900 |
2 | 100 | 200 | 500 | 800 |
3 | 600 | 100 | 200 | 900 |
So the total will be calculated for each employee
Input Q2
Empid | Jun | Jul | Aug |
1 | 200 | 300 | 400 |
2 | 100 | 200 | 500 |
3 | 600 | 100 | 200 |
Output
Empid | Jun | Jul | Aug | Total |
1 | 200 | 300 | 400 | 900 |
2 | 100 | 200 | 500 | 800 |
3 | 600 | 100 | 200 | 900 |
Note: Headers are changing
Is there a way I can do this in the same workflow other than giving the user 4 different workflows for 4 quarters or radio buttons to chose the workflow?
Hi @hemant86 you can still use the same concept of pivioting your data. I made some changes like using the Empid as a unique ID when I pivot and sum up the total and then eventually join the data back together.
Thanks @JosephSerpis . That worked great for me🙂