Weekly Challenge

Solve the challenge, share your solution and summit the ranks of our Community!
New content is available in Academy! You may need to clear your browser cache for an optimal viewing experience

Challenge #74: Build a Factorial Calculator

Highlighted
Asteroid
 
Highlighted
Alteryx Partner

Cool - never did a macro before.  Got it to work, though I could not figure out how to edit the icon to add the "n!".  I assume it is just a matter of editing the png file.

 

Spoiler
Process
- Insert rows up to "Number" in input
- Initialise field "factorial" = 1
- Update Factorial (grouped by "Number" to [RowCount] * [Row-1:Factorial]
- Set a "Result" field to 1 if RowCount = Number (else 0)
- Filter for Result =1
- Clean up fields
- Convert input to a macro input (right-clicked on input) and selected "Convert to macro input"
- Added macro output
- Added to container (not sure that is necessary...)
- Saved as macro
- Configured image using Interface Designer

MySolution_icon.PNG

MySolution_macro.PNG
Highlighted
Alteryx Partner

Nice little Multi-row Formula exercise with this one.

Spoiler
image.png
Asteroid

PFA my solution

Highlighted
Asteroid

Hi All,

 

Please find my Result below.

 

Spoiler
Probably not the intent but i took this as an opportunity to use R-Script.... So you don't need a macro, However i Packaged my answer up into one anyhow to comply with the aim... This is my first script and there was a little trial and error, So you will see i left some messages in the script that helped me work out the syntax.

 

Thanks

Mat

Highlighted
Asteroid
 
Highlighted
Asteroid

My solution

Highlighted
Alteryx Partner

My solution

 

Spoiler
challenge_74_RODO_Solution.pngchallenge_74_RODO_Solution_Macro.png
Highlighted
Asteroid

Been holding off on macros - a little bit of building them up in my head to be honest - but this wasn't too bad!

Spoiler
challenge_74_solution_justindavis.PNG
Highlighted
Alteryx Partner
Spoiler
AWC74.PNG

Really fun macro practice!