A solution to last week's challenge can be found here.
Challenge #74: Build a Factorial Calculator was published way back in June 2017. It pushed Alteryx designers to make a macro to calculate factorials. A worthy goal, to be sure.
It is time to dust off an old classic and ramp up the difficulty a bit.
My manager, Sydney, is obsessed with iterative macros and wants to see if I can use them properly. Sydney loves clean workflows, so there may be no other tools on the workflow canvas other than a single input, the macro, and a single output. And finally, my manager is entertained by simple things. Sydney likes the idea of the macro spinning around and around, calculating the factorials one multiplication problem at a time. So, the iterative macro must conduct a single multiplication per input number on each pass.
Are you up to this new challenge?
Here are the original challenge requirements to refresh your memory on factorial calculations:
Factorials are commonly used to calculate the multitude of ways a task can be completed—such as how many possible results could come from shuffling 52 playing cards.
Factorials are usually represented by ‘n!’—n being an integer. If we were looking for the factorial of 4, it would be represented as 4!. To calculate the factorial of 4, the equation is written as (4)*(3)*(2)*(1). The following are some example calculations:
1! = (1) = 1
2! = (2)*(1) = 2
3! = (3)*(2)*(1) = 6
4! = (4)*(3)*(2)*(1) = 24
New Challenge Requirements:
- You must use an iterative macro.
- You must conduct only one multiplication step on each input row, on each iteration.
- The workflow must consist only of: Text Input - Macro - Output