Discussion thread for day 6 of the Advent of Code - https://adventofcode.com/2025/day/6
Fairly straightforward one today, no macros needed... just some simple clean-up/rearranging of data... now back to enjoying my OTHER Advent Calendar 🥃
Wow, that was wild. So much slicing and dicing that I feel like a surgeon... but unexpectedly on numbers. Thankful it took less than an hour!
My part 2 gotchas:
Is this half of it?
My WF totally depends on fixed data schema of input data and does not have generalizability, but in order to enjoy my Saturday life, I compromised about it.
And, many thanks to Alteryx product team for adding "Product" option in the Summarize tool since 2023.2 release. It really helps!
Another simple problem??? The trickiest part of today was the testing of my reading comprehension.
Version 2 (More Elegant/Clearer Design):
Happy Solving!
Got stubborn about working in columns rather than just tokenizing to rows. Ran into the column limit on parse and just bulled through it with substrings. Do not do these things. If you're looking for how to do the thing, look elsewhere today. Your princess is in another castle.
Day 6 complete, halfway through already?! This problem served as yet another reminder to check the field length on the input tool (one day I'll remember to check first) 😂
2) Next, I decided to separate the operators from the numeric values. This allowed me to then join back based on the previously created column ID, so that I knew exactly which operation should apply to each number.
3) With the separate operations identified, I filtered to the multiplications and used the summarise tool to find the product of the numbers, per column.
4) All the remaining values (answers to the multiplications and the values that were originally addition) can now be unioned together. By summing the column containing the unioned answers, the grand total can be calculated.
My part one and part two are actually begin quite differently to each other. Other than sharing a row ID, the two data streams split almost immediately.
1) As we now know the cephalopods read numbers vertically, I decided to tokenise each row, at the single character level (spaces included), before assigning a vertical ID.
2) By filtering out the operators, I could then focus on just the numbers. As all vertically aligned values now share an ID, it was a simple case of concatenating the values to find the cephalopods' numbers.
3) Similarly to part one, I then joined the numbers back to the operations, based on the vertical ID. Unfortunately, because the ID was no longer based on the entire “original column”, there were some missing operators. The operators always appear in the first Vertical ID of the column, so a simple multi-row can populate the remaining values.
4) Now, in order to assign the original column ID I used another multi-row formula, which counted up one, whenever it came across a space.
5) The final steps are the same as above, as the multiplications were calculated first, before all the remaining numbers were then summed together to arrive at a grand total.
