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

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 #79: Find the Closest Prime Number

AliMc7
6 - Meteoroid

Really wanted to try solving this with an iterative macro, as part of prep for taking the Advanced cert this week. Got there in the end, but not very happy about needing 2 macros - one to look for the closest Prime down from the input # and one for the closest Prime up. Think this could be a lot more elegant, but it does work at least. Thanks!

 

Spoiler
Solution
#79_Prime numbers app_Ali solution.PNG

Iterate down
#79_Prime numbers app_IterateDown_Ali solution.PNG

Iterate up
#79_Prime numbers app_IterateUp_Ali solution.PNG
cmoussa
8 - Asteroid

WF.png