Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2025 Day 1 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

Discussion thread for day 1 of the Advent of Code - https://adventofcode.com/2025/day/1

32 REPLIES 32
aiahwieder
9 - Comet

. . . FIRST?!

Hub119
12 - Quasar
12 - Quasar

Definitely took longer than it should have... spent way too much time last night debugging the smallest of issues...

Spoiler
AoC 2025 D1 Pic.png
clmc9601
13 - Pulsar
13 - Pulsar

20% build, 80% debug... off to a strong start 😂

 

Spoiler
multi-row formulas for the win
2025-12-01_09-51-56.PNG
DataNath
17 - Castor
17 - Castor

Day 1 done! A huge shoutout to @OllieClarke - flashed me a screenshot of his workflow and made me realise I could just use a Multi-Row Formula for what I was trying to brute force in a 550k-iteration macro.

 

Spoiler
Workflow.png
lwolfie
11 - Bolide

Yay! Starting off with 2 stars!

OllieClarke
16 - Nebula
16 - Nebula

There's definitely a better way of doing this, but I was surreptitiously solving while on calls, so didn't have the brain space to think about clock maths

Spoiler
Day 1.png
ScottLewis
11 - Bolide

Returning to my favorite time of year.

Work priorities make it so I can't chase times this year, which is probably better for my health anyway.

 

Part 1 was straightforward other than the usual case in the data but not in the sample. 

 

Part , thought about elegant math solutions involving mod 100 and such.

Then realized that if you break L68 into 68*L1 then you can solve Part 2 the same way as Part 1.

Generate rows is, as ever, the Alteryx equivalent of outsourcing if outsourcing actually worked.

 

 

 

Jeff_Neklason
8 - Asteroid
8 - Asteroid

Twas' the first day of AoC....

Day 1 Screenshot.jpg

Are we having fun yet?
Pilsner
13 - Pulsar

Part two took a bit more thinking than I expected, but it was a fun start to the AoC!

Spoiler
Here's a screenshot of my full workflow: I've outlined my method below for anyone interested:
Pilsner_0-1764609789009.png

My approach for both parts actually revolved around running totals. Some of the other solutions people have posted take a much smarter route to help with part two, but here's my thinking:

Part 1:
1) I began by separating out the direction and the numeric value using some regex:
Pilsner_1-1764610035445.png


2) To make life easier, I decided to convert all the "Left" moves into negative numbers, and leave the right ones as positives:

Pilsner_2-1764610128427.png


3) Next i needed to account for the fact we started at 50. I did this by simply unioning a record with a value of 50, onto the top of my other data. (Yes i originally forgot about this, so was frustrated with myself when I realised this was the issue, but I made it in the end).

Pilsner_3-1764610274736.png



4) As my left and right values, were represented as negatives and positives, I didn't need to consider their directions separately. Instead, I could just create a running total!

Pilsner_4-1764610351624.png



5) This does mean I now have some records with a position outside of the range 0 - 99 but that didn't actually matter too much. As there were 100 numbers on the dial, I knew that any multiple of 100, is actually pointed at 0. With this in mind, all I had to do was filter to the records where the running total was a multiple of 100, and the count how many of these records there were: 

Pilsner_5-1764610495102.png

Part 2:

For part two, I simply continued on from the running total step, created in part one.

1)  As I had used a running total, I decided I needed to have an ID which indicated which "multiple of 100" my data was say within. i.e
- 0-99 would be 0
- 100-199 would be 1
- (-99) - 0  would be -1   etc...

I called this "ID", "Hundred component".

Pilsner_6-1764610713241.png

2) Next the premise was relatively simple to implement by using a multirow, but there were a few edge cases that needed to be accounted for. All I wanted to do, was say, if the "Hundred Component" changed, then it means I have passed 0. This holds because if you consider the following

- Start on number 47, (with a hundred component of 0). 
- Rotate to 134 (with a hundred component of 1). 
- Calculate the difference in the "hundred components", 1-0 = 1. 
- Therefore I went past the starting point (at 0), 1 time. 

However, the edge cases included the following:

- If you start at 137 (hundred component of 1)

- Move to 100 (hundred component of 1)
- Move back to 152 (hundred component of 1)

These all have the same "Hundred component" meaning my previous logic would not hold.

Fortunately, it was possible to fix this by simply adding a couple of "If statements" into my multi-row, to explain, that if you are currently on (or were previously on) a multiple of 100, then you need to either add 1, (or not add one) to the number of full rotations, given by your last move. Please see multirow below for further detail:

Pilsner_7-1764611224832.png



3) Finally, it was just a simple case of summing up the column created by the multirow. 

 

Pilsner_8-1764611304944.png

 


 

Labels
Top Solution Authors