Hi everyone, I'm trying to take some old SPSS code and turn it into an alteryx workflow but I needed some help on how to deal with the percentages.
Im using the formula tool to create these percentages, I'm just not sure how I can use them correctly in the summarize tool.
My data looks something like this
Customer Number | Market Share | Quote Rate | Other Rate |
12345 | 1 | 1 | 1 |
12345 | 1 | 0 | 1 |
98765 | 0 | 1 | 0 |
98765 | 1 | 1 | 1 |
54321 | 1 | 0 | 0 |
Im using the summarize tool to group by customer number but I don't know how I can use it to correctly show the percentages.
Im still new to this so it might be an easy solution but if anyone can help Id really appreciate the help 🙂
Solved! Go to Solution.
Hi @automate
Here are two different ways that you can calculate the customer percentages for all 3 of your columns
Both use a pair of summarize tools to calculate the grand totals of all the items and the customer totals. These are joined and then a formula tool calculates the percentage. The top container assumes that you will only only ever have the three columns that you gave in your input. The formula tool calculates one percentage for each column. The bottom one is dynamic and will handle any number of columns. First, transpose the values. In the two summarize tools group by the name column as well as the columns from the top container. Join the outputs on Name and then build the ColumnLabel field as calculate the percentages.
The results for both methods are similar
Dan
Thank you so much!! I tweaked this a little bit to accept the formulas I was trying to create and it worked amazingly!