Alteryx Designer Desktop Discussions

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

Create columns with percentage of total

JoaoFernandes
7 - Meteor

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 SalesMay SalesJun SalesJuly Sales
Store 1

120

220200230
Store 2150135120200
Store 315070120140
Store 48065100120
Total500490540690

 

And I would like to get some output like this:

 

 April Sales% of totalMay Sales% of totalJun Sales% of totalJuly Sales% of total
Store 1

120

24%22045%20037%23033%
Store 215030%13528%12022%20029%
Store 315030%7014%12022%14020%
Store 48016%6513%10019%12017%
Total500 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.

3 REPLIES 3
nick_ceneviva
11 - Bolide

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

JoaoFernandes
7 - Meteor

Nick, it works great. Thank you very much for your help. Cheers!

noemizito
5 - Atom

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!

Labels