General Discussions

Discuss a wide range of topics! Questions about the Alteryx Platform should be directed to the appropriate Product discussion forum.

General Discussions has some can't miss conversations going on right now! From conversations about automation to sharing your favorite Alteryx memes, there's something for everyone. Make it part of your community routine!

Advent of Code 2020 - BaseA Style (Day 9)

AkimasaKajitani
14 - Magnetar

Day 9!

 

Today I made Iterative macro, too.

I'd like to learn Non-Iterative version by anyone's workflow.

 

Spoiler
AkimasaKajitani_0-1607518101864.png

Part1 Iterative Macro:

AkimasaKajitani_1-1607518133329.png


Part2 Iterative Macro:

AkimasaKajitani_2-1607518153774.png

 

But It takes less than a minute, so I think no problem.

 

As anonymous user #1105310

 

NedHarding
7 - Meteor

Fun problem...  Again no macros - but I did cheat and use Alteryx to generate a super long expression for a multi-field formula for part 1.  Without adding the recordID I needed for Part2, part1 has a (cheater) golf score of 3.  Part2 looks like almost exactly the same solution as @jdunkerley79 

 

https://github.com/NedHarding/Advent2020

 

Spoiler
NedHarding_0-1607522995553.png

 

OllieClarke
13 - Pulsar
13 - Pulsar

Bit of data explosion never hurt anyone 🙂

Spoiler
Still runs in 1.1 seconds...Day 9.PNG

peter_gb
8 - Asteroid

Really interesting to see these non-macro alternatives and that they seem to be faster computationally too -  enjoying these and learning a ton!

danilang
17 - Castor
17 - Castor

Non-macro part 1 and iterative part 2.  Runs in 4.4 seconds non-Amped and errors in Amp and 3.4 in Amp. 

 

The first time I tried it in Amp, the logic in my macro failed because it implicitly assumed that the records in the iterative input wouldn't change order between iterations.  It's technically not between iterations, but in the tools that prepare the records to be sent out the iterative output.  The solution was to add a Sort tool before the multi-row.       

 

+1 Amp knowledge

 

Spoiler
Part 1 does an X join to get all the sums and joins the sum to the target then removes the records where the inputs are outside of the look back range.  Used a text input to modify the look back range as opposed to @jdunkerley79 workflow constant
main.png
Part 2 uses an iterative macro with a multirow to generate a running total starting from Engine.Iterationnumber +1 and ending when the total >= target 

Macro.png

Dan

cgoodman3
12 - Quasar
12 - Quasar

A no macro solution with generate rows creating the data.

 

Spoiler
cgoodman3_0-1607533515941.png

 

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
Jean-Balteryx
13 - Pulsar

Cleaner than I expected, especially for the part 2 macro !

 

Spoiler
2020-12-09 18_43_04-Alteryx Designer x64 - AOC_2020_Day_9_Iterative_Macro_2.yxmc.png2020-12-09 18_43_21-Alteryx Designer x64 - AOC_2020_Day_9_Iterative_Macro.yxmc.png2020-12-09 18_55_40-Alteryx Designer x64 - AOC_2020_Day_9.yxmd.png
stephM
8 - Asteroid

Went for 2 x iterative macros! Not clean at all, but just happy I got to the answer 😂

 

Spoiler
stephM_1-1607551357502.png

 

Part A iterative macro (messy!):
stephM_2-1607551423885.png

Part B iterative macro:

stephM_3-1607551480238.png

 

EstherB47
14 - Magnetar
14 - Magnetar

Definitely not winning on tool golf, but my speed is on point. Or on fleek as my 18 year old niece tells me I should be saying.

 

1.7 seconds.

 

EstherB47_0-1607562453641.png

Still going with no macros

Top flow generates all possibilities of number sums that could be used. Middle flow generates just the ones that will be used. These are joined together. Any set of numbers that doesn't find a match is output.

Second part took a bit more thought. Didn't want to generate all combos of numbers, so tried out different looks at the running total. Turns out that subtracting the number from the running total gets you the segment of comparison. 

 

Loads of generate rows tools got the job done. Would be lovely to feed a measure into the sample tool, which was more performant for me than filters,, to make this totally dynamic.

patrick_digan
16 - Nebula
16 - Nebula
Spoiler
I went for an append and then was able to use joins. It was running in 2 seconds so I was happy.
patrick_digan_0-1607569382794.png