Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2020 - BaseA Style (Day 7)

Jean-Balteryx
16 - Nebula
16 - Nebula

Discussion thread for day 7 of the Advent of Code : https://adventofcode.com/2020/day/7

16 REPLIES 16
NicoleJohnson
ACE Emeritus
ACE Emeritus

Golly, I do love me an iterative macro! 

 

Spoiler
Though I'm wary of iterative macros in the world of AoC (#IntcodeNightmares), this one seemed innocent enough. For now. 😉

I've built my fair share of "parent-child" macros over the years (six degrees of Kevin Bacon, anyone?), so this was at least a familiar path. Parsed out the bag descriptions & quantities and then built simple macros for part 1 & 2 to find the inner-outer combos (or outer-inner combos). While the macros were similar, they do lookup data in different directions, so created a separate instance for each part.

Day7.JPG

For Part 1 macro, used an iterative process that found the parent of every inner bag (and then the parent of that parent in the next iteration).   

Day7_Macro1.JPG
For Part 2, swapped the join to find the Inner bags & quantities for each Outer bag, summarized, then called them "outer" for the next iteration, repeating the process.
Day7_Macro2.JPG

Cheers!

NJ

https://github.com/AlteryxNJ/AdventOfCode_2020

T_Willins
14 - Magnetar
14 - Magnetar

Modified my standard/iterative inception macro set that I used for building trial balances.  After finishing I see that I could have used a single standard/iterative macro set to do both a&b, but it's Sunday night and there is a drink and a dip in the hot tub waiting.

 

Spoiler
WorkflowWorkflow

 

7a Standard Macro7a Standard Macro7a Iterative Macro7a Iterative Macro

 

 

7b Standard Macro7b Standard Macro7b Iterative Macro7b Iterative Macro

 

 

Greg_Murray
12 - Quasar

Similar to @NicoleJohnson's solutions.

 

Spoiler
Greg_Murray_0-1607324013887.png

part 1 iterative macro

Greg_Murray_1-1607324064243.png

part 2 iterative macro

Greg_Murray_2-1607324146898.png

 

 

AkimasaKajitani
17 - Castor
17 - Castor

Day 7!

 

I often fall into the trap of repetitive macros...

 

Spoiler
AkimasaKajitani_0-1607326578943.png

Part1 Macro :

AkimasaKajitani_1-1607326610619.png

Part1 Macro :

AkimasaKajitani_2-1607326637139.png

 

As anonymous user #1105310

PhilipMannering
16 - Nebula
16 - Nebula

My Solution

Spoiler
PhilipMannering_0-1607329104177.png

 

And my macros

Spoiler
PhilipMannering_1-1607329125328.pngPhilipMannering_2-1607329142784.png

 

peter_gb
10 - Fireball

Day 7 | iterative macros always make my head hurt but got there...

Spoiler
7.png

jdunkerley79
ACE Emeritus
ACE Emeritus

My brain was not working well enough for iterative macros this morning...

 

Think mine is a little different to others but same general idea

 

Spoiler
jdunkerley79_0-1607330690471.png


Macro:

jdunkerley79_1-1607330714908.png

 

Flows on GitHub: https://github.com/jdunkerley/adventofcode

cgoodman3
14 - Magnetar
14 - Magnetar

Note to self - Must read the question. I forgot to swap the inner bag to be outer bags in the second part so wasted a lot of time doing that!

 

Spoiler
cgoodman3_0-1607334899670.png

Macro for part A - familiar heirarchy macro

cgoodman3_1-1607334965666.png

Macro for part B:

cgoodman3_2-1607335030020.png

 

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
dsmdavid
11 - Bolide

Similar to others'

Spoiler
Alteryx_Day_07.png

also, keeping track of the lineage...for no apparent good reason (yet, who knows what future days have in store for us...).

Spoiler
Alteryx_Day_07_lineage.png

https://github.com/dsmdavid/AdventCode2020

 

Labels
Top Solution Authors