Weekly Challenge

Solve the challenge, share your solution and summit the ranks of our Community!
IDEAS WANTED

We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!

Submit Feedback
We've recently made an accessibility improvement to the community and therefore posts without any content are no longer allowed. Please use the spoiler feature or add a short message in the message body in order to submit your weekly challenge.

Challenge #154: Permute the Data

Highlighted
14 - Magnetar
14 - Magnetar

Excellent, @MarqueeCrew ! Where I'm struggling though is how can you make it handle more than two toggles (on/off, e.g.)  IntToBin is wonderful for 2 choices, but how can we make this work for 3, 4, 5 different answers for each option?

 

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@EstherB47 ,

 

Good point.  When I created this, I knew that I could handle the permutation calculation quickly enough.  I didn't think through how to create the states so fast.  I suppose that I'd have to do something like the append fields trick or multi-row to handle the appropriate state answers.

 

Congrats again on staying ahead of me in the solutions race.  With zealous community members like @Thableaus and @DavidP leading the group, it's nice to see you rounding out the group.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Highlighted
The Force

This is definitely a brute force method as I am still working on the macro to be more dynamic. Definitely curious to see if anyone can be dynamic without using a macro!

Spoiler
Challenge 154.PNG
Highlighted
17 - Castor
17 - Castor

Hi @EstherB47 

 

Here's my second pass at it with a custom iterative macro that does IntToBaseN(). 

 

Results v2.png

 

 

Spoiler
The results are returned as a alpha string (AAA,AAB,etc) to get more than 10 toggle positions,  which is then joined back to the list of toggles.  The InttoBaseN just applies math to do the conversion.

MainMainIntToBaseN MacroIntToBaseN Macro 

Cheers 

 

Dan

Highlighted
6 - Meteoroid

@MarqueeCrew, I really like the simplicity of your solution in the sense that it's a clean way to do the math without brute-forcing it with nested append tools like I did.  I'm curious to know why you wrote your formula the way you did in Formula Tool (50).  Couldn't you just leave off the "-1"?  It looks like you account for it in your Generate Rows (40) by having your initialization expression at "0".  I'm wondering if there's a reason you did it this way.  Also, the Concat Options is clever.  I think if I had thought of that from the beginning of my solution, things would have turned out differently - I seem to remember banging my head against the wall yesterday as I have all the results themselves concatenated as "Off,On,Off" (etc.), but was stumped at to how to break out the actual tool labels.  Definitely one of those "so obvious, why didn't I think of that".  Good experience to implement in future workflows, thanks!

Highlighted
Alteryx Certified Partner

Don't need maths - leave it up to chance!

 

Spoiler
Generate shed loads of rows and assign either 1 or 0 (On or Off) at random. Concatenate these and take all unique options. Voila!

Capture.JPG
Highlighted
13 - Pulsar

Here is my workflow for this challenge!

 

Spoiler
Permute the Data.PNG
Highlighted
8 - Asteroid

Wow... nice challenge this week... Had to really think about it...

 

The solution is dynamic... you can change either option 1 or option 2 input and it will assign them correctly...

 

The final results works... not the same order as yours though...

Highlighted
8 - Asteroid

Hi! Here my solution 🙂

Highlighted
8 - Asteroid
Spoiler
AWC_154.PNG