The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start 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

JamesCameron
アステロイド

My Effort

 

スポイラ
JamesCameron_0-1576757417159.png
nini
アステロイド

I try to find the closest prime number less than or larger than the given number using batch macros

nini
アステロイド

not batch macro, iterative macro

Carlithian
11 - Bolide
11 - Bolide

Ah, love an excuse for an iterative macro 🙂


Happy Alteryxing
ArnavS
Alteryx Alumni (Retired)
 
rmassambane
ボリード
 
danicahui
アステロイド
スポイラ
1. Standard macro defining whether a number is prime
Challenge 79a 2020-01-20.jpg

2. Iterative macro to find the closest prime number above (and another for below)
Challenge 79b 2020-01-20.jpg

3. App to find closest prime
Challenge 79c 2020-01-20.jpg
mbogusz
コメット
スポイラ
2020-01-26 16_36_36-Greenshot.png
ImranA
アステロイド

really enjoyed this one, interesting challenge! shame there isn't much of a practical application!

 

スポイラ
ImranA_0-1580745171265.png
JennyMartin
コメット
スポイラ
AWC79.1.PNGAWC79.2.PNG

Really fun challenge! I will say that the macro I built will always favour the higher number if there are prime numbers equidistant from the inputted number e.g. if the user enters 4 then it will return 5 rather than 3.