Free Trial

Alteryx Designer Desktop Discussions

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

Christmas Riddle

ulrich_schumann
8 - Asteroid

Hi all,

 

just saw a Christmas riddle and was wondering how to dispay ALL possible cominations of fragments into an Excel list. Enclosed is a short table with 5 positions (POS) and 3 possible fragments per position. If you put all possible cominations in the list, you would finally see somewhere the solution to the riddle.

 

The expected solution is for

POS1 MER

POS2 RYC

POS3 HR

POS4 IST

POS5 MAS

 

Any ideas how to create the entire list of all possible combinations (order is already fixed by the position) with an Alteryx workflow?

 

"MERRYCHRISTMAS" to the Alteryx Community.

 

6 REPLIES 6
Claje
14 - Magnetar

This was a neat one, that gave me an excuse to use a "Multi-Output Filter" macro which made this really easy.

 

The key was using Append Fields to create the list of all combinations.

jdunkerley79
ACE Emeritus
ACE Emeritus

My quick go from first principles:

2018-12-19_18-35-43.png

 

Generate a set of rows and then join to input

ulrich_schumann
8 - Asteroid

Great, thanks! Now need some time to follow along the logic ... :-)

 

ulrich_schumann
8 - Asteroid

Understanding your macro might cause me some headache :-) But very good learning experience for me. Thanks for sharing!

Claje
14 - Magnetar

Hi,

 

I didn't write that macro either, but I think I can summarize what it is doing!

Basically it is creating a list of what options should be output, and is giving each one an ID.  So in your example, we take the POS field, which conveniently has five values, and tell it to output each value to its own output stream, in the order they are read in.  In our data, since it was already sorted by the POS field (POS 1 was the first set of records, POS 5 was the last), this meant that everything was already well ordered for this process.  You can also have it output by number of records, which would output the most common POS to #1, the second most common to #2, etc.

What this essentially does is give us a set of up to 5 outputs, plus an overflow.  Fortunately in this case, 5 outputs was exactly enough (we had 5 different POS values).

ulrich_schumann
8 - Asteroid

Hi Claje,

thanks for the further explanations. In the meantime I have replaced the macro by 5 filter tools to get the 5 POS-related fragments separated. Then following your solution was "easy going". I like your approach very much - nice and easy.

 

Labels
Top Solution Authors