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

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Calculations go Wrong in a Iterative Macro

MostafaBouzari
8 - Asteroid

Hello Everyone,

I try to do some calculations inside of a Iterative Macro but the Results are not what we expected.

EK Column should be 13,93  for all the records but i think the problem is with Running Total which is used in Macro and generates wrong results.

how can i fix this?

 

(The Picture is basically what we want to get)

 

Regards
What we expectWhat we expect

4 REPLIES 4
fmvizcaino
17 - Castor
17 - Castor

Hi @MostafaBouzari ,

 

Please check if now it is running as expected, I only corrected the [EK] multi-row formula, since you were filling all value in your first iteration, there were no null values to recalculate this column so I've changed to control this column based on number of iterations

 

if [Iterations]<=[Engine.IterationNumber]+2 then [RunTot_Value EUR]/[RunTot_Volume] else [EK] endif

 

Best,

Fernando Vizcaino

echuong1
Alteryx Alumni (Retired)

You don't actually need an iterative macro to achieve this - you just need to modify your multi-row formula.

 

In your first original multi-row formula, you were referencing EK for the Value EUR calculation. Most values for EK were null, which is why your Value EUR formula resulted in null values as well. I suggest filling in the EK values first, then using multi-row for Value EUR and the running total.

 

See attached. Hope this helps! 

 

echuong1_0-1599832385792.png

 

David-Carnes
12 - Quasar

I don't understand why you need the iterative macro.  I got the expected results in-line:

4 Mostafa.png

MostafaBouzari
8 - Asteroid

EK was a calculated filed so i couldn't use it the way you used it 

Labels