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

Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #183: Roman Numeral Math

pasccout
8 - Asteroid

Here is my solution but I can't figure out how you got to that result without respecting math order of calculations PEDMAS?

 

TonyA
Alteryx Alumni (Retired)

I would have had this done an hour ago, but I was trying to figure out why I was getting the "wrong" answer.

Spoiler
Didn't know about Dynamic Replace so I used a macro, but I did learn something new today. Thanks, Martyn!!
hbraunius
8 - Asteroid

My solution here.

JORGE4900
8 - Asteroid

I took this challenge to practice some REGEX to separate the fields. 

 

Parse: (.*?)\+\s(\*?)\s(.*?)\+\s(\/?)\s(.*?)\+\s{2}(\+?)\s(.*?)\+\s(\-?)\s(.*)\+

 

Spoiler
2019-09-30_11-11-04.jpg
benakesh
12 - Quasar

Installed custom functions to try fromRoman() .   More details here :  https://community.alteryx.com/t5/Engine-Works-Blog/An-Overview-of-the-Alteryx-Abacus-Add-In/ba-p/398...

 

This is a good example  for 'find and replace' and  'dynamic replace'. 

 

Bdonahue
7 - Meteor

I too got a weird number doing things in the correct order of operations.  

Spoiler

Maybe the romans did a different order of operations?  I took each value, the equation into words vs. operators.  Joined by record position to each other so we'd know the function to be performed on the following line.  I used a batch macro to convert to standard numbers by dividing each symbol into rows, determining via multi-row if it was a "subtractor" or an addition value and then summed the values up.  I then put this into an sort by Order of operations and position ranking so * and / came first then by relative position followed by +/- and relative position left to right.  I ran this through an iterative macro and took the final output as the value.
Screen Shot 2019-09-30 at 12.09.30 PM.pngScreen Shot 2019-09-30 at 12.09.40 PM.pngScreen Shot 2019-09-30 at 12.09.51 PM.png
T_Willins
14 - Magnetar
14 - Magnetar

Without additional information, I am going to say the PEMDAS answer is correct, which is what I tie to.

 

Spoiler
Macro 183.JPG

 

Workflow 183.JPG

 

cgoodman3
14 - Magnetar
14 - Magnetar
Spoiler
Like others I didn't get the supplied answer as I followed the order of operations (being a Brit I know it as BODMAS (Brackets, Orders, Division, Multiplication, Addition, Subtraction)) and got 15,197 which is similar to others.

Originally approached it by summing the numeric value of the roman numerals but this doesn't work as IX is 9 and not 11 (if you sum them), so built in some logic to add in hierarchy to the roman numerals.

Challenge 183.PNG
I also ended up with a long multi-row formula to do the maths bit 😕
Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
nivi_s
8 - Asteroid
Spoiler
image.pngI had no idea how to convert a field into a formula until I saw Martyn's solution with the Dynamic Replace, so thanks!
image.png

Challenge #183 solved!

 

PhilipMannering
16 - Nebula
16 - Nebula

Good challenge. First time I've use the dynamic replace - essentially as an 'eval' function. Solution attached.

 

Spoiler
workflowworkflow