community
cancel
Showing results for 
Search instead for 
Did you mean: 
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Weekly Challenge
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Unable to display your progress at this time. Please try again a little later, or contact an administrator if you continue to see this error.
Announcement | Get certified today - take the Alteryx Designer Core and Advanced exams on-demand now!

Challenge #154: Permute the Data

Pulsar

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?

 

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.
Bolide

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
Aurora

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.

Solution v2.pngMainMacro.pngIntToBaseN Macro 

Cheers 

 

Dan

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!

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
Quasar

Here is my workflow for this challenge!

 

Spoiler
Permute the Data.PNG
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...

Asteroid

Hi! Here my solution :)

Spoiler
AWC_154.PNG