Alteryx Designer Desktop Discussions

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

Percentage of total for binary data

s100
5 - Atom

Hello,

 

This first table is my original data which contains several columns with binary data 'Yes' or/and 'No'. 

 

Col1Col2Col3
YesYesNo
YesYesNo
NoYesNo
NoYesNo
YesYesNo
YesYesNo
YesYesNo
YesYesNo
NoYesNo
YesYesNo

 

The second one is the output table that I need.

 YesNoTotalScore
Col173100.7
Col2100101
Col3010100

 

I tried Summarize tool to get the count of 'Yes' and 'No' for each column. However, if I have 20 columns, then 20 summarized tools need to be used which I think is too complex.

 

Please help me if you know a better way. Any help is appreciated!

4 REPLIES 4
AngelosPachis
16 - Nebula

Hey @s100 ,

 

One way would be to transpose your data so you only need a single summarize tool to count the Yes/Nos per column.

 

AngelosPachis_1-1622703813231.png

 

Then you only need a formula tool to find the score.

 

Hope that helps,

 

Angelos

AngelosPachis
16 - Nebula

@s100  A neater solution, use a Frequency Table tool from the Data Investigation tool palette.

 

AngelosPachis_0-1622704047598.png

 

Same results more or less, but only a single tool used and it will automatically return the Score value

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @s100 

 

Here is how you can do it.

 

Workflow:

atcodedog05_0-1622704348109.png

 

1. Using transpose tool converting column name to rows.

2. Using formula tool create count column.

3. Using crosstab converting rows to table with column with yes, no & total.

4. Using formula tool calculating score.

 

Hope this helps 🙂

 

s100
5 - Atom

@AngelosPachis @atcodedog05 Thank you so much for your help! These solutions work.

Labels