alteryx Community

General Discussions

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

Advent of Code 2021 Day 5 (BaseA Style)

16 - Nebula

18 REPLIES 18
7 - Meteor

I guess my teachers were right and we did need to remember y = mx + b. A great opportunity to use the generate rows tool!

Spoiler
Step 1: Parse out the lines
Challenge 1:
Step 2: Fitler for just horizontal and vertical
Step 3: Generate X positions
Step 4: Generate Y Positions
Step 4: Group by X,Ys of generated positions and count
Step 5: Filter for any > 1
Challenge 2:
Step 2: Calculate m and b
Step 3: Generate X positions
Step 4: Calculate y using y = mx + b
Step 4: Group by X,Ys of generated positions and count
Step 5: Filter for any > 1'

12 - Quasar

Lots of Generate Rows!

Spoiler
13 - Pulsar
Spoiler

Again another day where the part two wasn't that much more difficult than the first part. I just got stuck down a rabbit hole as the first attempt at building it out I had forgotten that there could be diagonals in both directions, so it's not just as case of generating the x.y co-ordinates as you need to factor in increasing and decreasing values in x and y and because I was using a join based on position instead of calculating the order needed to get my ordering correct. So while most of the time it is beneficial being able to use assumed sort in Alteryx if you are relying on a particular order you can't! So that resulted in the second part taking much longer than the first!

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
14 - Magnetar

Solved for stars and then played tool golf to get it down to this combination... Though I'm a bit disappointed in myself now that I see @bflick bringing back y=mx+b. Missed out on an opportunity to finally use that particular tidbit of knowledge! 😂

Spoiler

Cheers!

NJ

15 - Aurora

I use only one Generate Row tool to make diagonal line. It is a pretty forceful way. But it took long time to make the condition expression.

Spoiler

GitHub

15 - Aurora

Wow, taking me back to HS math.

abs(ATAN2([y1]-[y2], [x1]-[x2]))*180/3.14 (to find 45 degree diagonal lines)

y=mx+b

My solution resembles @bflick 's solution

Spoiler

15 - Aurora

Very straight forward this time. Could have simplified the first one, but I'll need breakfast first.

Spoiler

11 - Bolide
Spoiler
Thought this could be a good fun for spatial or golf. Went with golf...