alteryx Community

# General Discussions

Discuss any topics that are not product-specific here.

## Advent of Code 2023 Day 4 (BaseA Style)

Alteryx Community Team

Discussion thread for day 4 of the Advent of Code - https://adventofcode.com/2023/day/4

48 REPLIES 48
11 - Bolide

Forgot to post my solution last night after (temporarily) giving up on the Python solution I attempted after solving in Alteryx.

Anyway, I used an iterative macro for part 2, and I don't regret it. Sorry not sorry.

Spoiler

12 - Quasar

Too many people mentioning iterative macro crashing their sys. I refused to use a macro.   Runtime = 0.5 sec

Spoiler

15 - Aurora

Tried to refine, but not getting much better.

Spoiler
Taking out Generate Row outside Macro makes running time somewhat faster.
17 - Castor

First day that requires a macro - this is going to quickly become normal I reckon!

@clmc9601 - very elegant - I tackled the inner macro differently but I see why yours works!

Spoiler

Part 1:
- Just parse the data out
- then do a join and summarize

Part 2:
- My embedded macro was a little more complex than Claire's.
- Each iteration, it takes the lowest number card remaining - outputs the total and expands it out below
- this repeats until it runs out of cards

15 - Aurora

Very grateful to @patrick_digan , who showed me the magical use of the multirow formula tool during the Intcode fiasco of 2019

I did use what appears to be a useless summarize tool to figure out how many rows above I'd need to be counting. And I figured out the logic by modeling the sample data in Excel (whee, typing x into columns and then adding up and trying to discern a pattern!)

Spoiler

The logic, as I saw it, was that for a row above to add records to the current row, the number of cards generated for that row above must be greater than or equal to the numbers of rows above. For example, for 3 rows above, there need to be 3 or more generate cards to touch the current row.

Not sure if it's the best way to solve this, and it did work and no macros. And my part 3 is efficient with only three tools (one of which isn't needed after the first run)

8 - Asteroid

Fun to create an iterative macro after a long time

Spoiler
9 - Comet
Spoiler
9 - Comet
Spoiler
WF
MACRO
8 - Asteroid

My solution.

Spoiler

5 - Atom

Advent of Code Part 1. Feels a lot more messy than it should be

Labels