Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

Summarize a table results in percentages

federicohernandezd
6 - Meteoroid

Hi, I'm quite new to Alteryx and have to do a report about a survey by using the software.

 

I'm not sure of how to summarize the data based on the answers. 

 

Some Context:

For each question the answer goes from 0 to 10, if the value is between 0 and 6 is categorized as "BAD", if its 7 or 8 "REGULAR" and if its 9 or 10 "GOOD"

 

Survey IDQuestion 1Question 2
0001610
0002109
000327
000475

 

With the Formula option I created a new table with the correct label using "IF THEN ELSEIF ELSE END"

Survey IDQuestion 1StatusQuestion 2Status
00016Bad10Good
000210Good9Good
00032Bad7Regular
00047Regular5Bad


Now I need to summarize the results for each question using percentages. Eg. For the Question 1, 50 % is "Bad", 25 % is "Good" and 25 % "Regular".


Which tool should I used? I tried summarize and failed... hopefully i explained myself.  Thanks 🙂

8 REPLIES 8
echuong1
Alteryx Alumni (Retired)

Two methods I would suggest:

 

Use the same method you used to assign the Good, Bad, and Regular values. Use a conditional formula to add in the numeric values.

 

Have a table with the corresponding numbers, and use a join.

 

echuong1_0-1615499410626.png

 

AngelosPachis
16 - Nebula

Hi @federicohernandezd ,

 

I think you should first try to restructure your data so you have your data extending vertically and not horizontally. That means, having a single column for survey ID, a single column for the question ID and the answer in that question (1-10) and then the flag of whether it's good or bad. I believe that will help you process the data now but also in the future.

 

AngelosPachis_0-1615499665826.png

 

The you can use a summarize tool to count the number of answers per question and in total.

 

AngelosPachis_1-1615499723786.png

 

Hope that helps, let me know if you have any questions.

 

Regards,

 

Angelos

 

TomWelgemoed
12 - Quasar

Hi @federicohernandezd ,

 

I'm a big fan of making these kinds of problems entirely dynamic, as they often grow out of hand (i.e. the formulas get more & more complex).

 

They way I would do that is by having a reference table (lookup table) that contains the upper & lower boundaries of the value you wish to assign, e.g. 0 (lower value) and 6 (upper value) with the result field containing the result (Bad). That way, if new permutations come in, e.g. "above average", you can simply add it to the table.


I've taken the liberty of stealing @AngelosPachis , starting workflow (I agree with him on the transposing of rows) - but just adding the reference tables to this. 

 

TomWelgemoed_0-1615501173874.png

 

I wasn't 100% sure on how you wanted to assign values & result scores, but hopefully when you run the attached workflow, you'll understand the concept I'm referring to. 

 

Feel free to ask questions of course!

 

Tom

 

federicohernandezd
6 - Meteoroid

Hi @AngelosPachis, thank you very much for the reply

With your example I finally understood Transpose and Crosstab tools, also, I will take your advice of processing the data vertically.

I just have one further question, in the "Summarize" you add a column named "Value" which isn't in the options, how come? I add a screenshot of the configuration tool for "Summarize"

federicohernandezd_0-1615766082980.png

 

Thanks!

 

federicohernandezd
6 - Meteoroid

Hey @tomwelgemoed, I find this approach quite interesting. Although the result I'm trying to get is different, this workflow is really flexible. I'll keep in mind using those formulas in the filters to simplify the amount of objects. New on Alteryx but willing to learn from those tips. Thank you very much!

TomWelgemoed
12 - Quasar

Hi @federicohernandezd ,

 

Yes, thanks for the feedback - indeed, it's really good when you want to create more dynamic & scalable workflows and you don't want to hard-code your formulas (but rather just map values directly). 

 

Good luck on your Alteryx journey!

AngelosPachis
16 - Nebula

Hi @federicohernandezd ,

 

That's a fair question, probably that was the artefact of some testing I was doing while building the workflow.

 

You can ignore it and substitute it with Question ID. So the configuration of the top summarize tool should be the following

AngelosPachis_6-1615896560630.png

 

and for the one below

 

AngelosPachis_7-1615896573572.png

 

Happy that this solution help you understand better Transpose and Cross Tab tools and sorry if this inconvenience with that Value field confused you.

 

Cheers,

 

Angelos

federicohernandezd
6 - Meteoroid

Great!! 

Thank you very much

Labels