Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Do I Need to Do Multiple Ifs?

katebrown5
5 - Atom

Hello - I'm an new user hoping for some help.

 

I have Y/N fields to indicate if someone met a specific criteria and want to create a field that gives me the combinations when the fields have a Y. 

 

For Example:

Brown Hair Y/N

Blue Eyes: Y/N

Left Handed: Y/N

Wears Glasses: Y/N

 

I want to know how many meet the combinations so - how many have brown hair and blue eyes, how many have brown hair, blue eyes, and are left handed, how many are left handed and wear glasses etc....

 

I was going to create if statements to group the possibilities together but before I did that I figured I would check if I was making this more complicated than I need to.

 

Thanks in advance!

Kate

6 REPLIES 6
MarqueeCrew
20 - Arcturus
20 - Arcturus
Try:
Summarize tool with
Groupby for each attribute and a count for a field of your choice (any field).

Cheers,
Mark
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
katebrown5
5 - Atom

Thank you! I figured there was an easier way!

JohnJPS
15 - Aurora

I thought this was a very interesting problem, e.g. to generate a report on all the various combinations, both positive and negative (e.g. "blue eyes and not blonde hair").

 

The attached workflow will do this.  There may be an easier way to do this with just core Alteryx tools, but I primarily used R here.  On the up-side, it does not reference the original column names at all, so should work for any set of Y/N columns passed into it.  Caveat: for a large number of columns, performance will likely suffer, since the number of possible combinations will grow exponentially.

 

 

katebrown5
5 - Atom

Thanks John - when I open the workflow I get a message that it references macros that are missing or inaccessible. 

combinationerror.PNG

I haven't used R yet but it is on my list of things to learn.

JohnJPS
15 - Aurora

Oops.  That's the Totally Transpose macro.

 

katebrown5
5 - Atom

Thanks! Appreciate the help!

Labels