Hello,
I'm trying to add some "percentage of total column" to my data and I was wondering what is the best way to do this.
I have a table looking like this:
April Sales | May Sales | Jun Sales | July Sales | |
Store 1 | 120 | 220 | 200 | 230 |
Store 2 | 150 | 135 | 120 | 200 |
Store 3 | 150 | 70 | 120 | 140 |
Store 4 | 80 | 65 | 100 | 120 |
Total | 500 | 490 | 540 | 690 |
And I would like to get some output like this:
April Sales | % of total | May Sales | % of total | Jun Sales | % of total | July Sales | % of total | |
Store 1 | 120 | 24% | 220 | 45% | 200 | 37% | 230 | 33% |
Store 2 | 150 | 30% | 135 | 28% | 120 | 22% | 200 | 29% |
Store 3 | 150 | 30% | 70 | 14% | 120 | 22% | 140 | 20% |
Store 4 | 80 | 16% | 65 | 13% | 100 | 19% | 120 | 17% |
Total | 500 | 490 | 540 | 690 |
Is it possible to have a generic formula/tool to do this? The months often change so the column names are not always the same.
Thanks in advance.
Solved! Go to Solution.
The attached workflow should do the trick and provide the flexibility to handle the columns name changing regularly. It uses the transpose tool to get the data in a format that is easy to calculate the Percent of Total and then the cross tab tool to get the data back to the desired state.
Please let me know if you have any questions! Hope it helps
Nick, it works great. Thank you very much for your help. Cheers!
Hi Nick
Thank you for the solution!
Unfortunately I have an older version of Alteryx, the 11.0.6, do you have the chance to post your solution with this version?
Thank you in advance!