Do I Need to Do Multiple Ifs?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
Solved! Go to Solution.
- Labels:
- Preparation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Summarize tool with
Groupby for each attribute and a count for a field of your choice (any field).
Cheers,
Mark
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you! I figured there was an easier way!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks John - when I open the workflow I get a message that it references macros that are missing or inaccessible.
I haven't used R yet but it is on my list of things to learn.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Oops. That's the Totally Transpose macro.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks! Appreciate the help!
