I am dealing with a challenge on how to translate Excel math to Alteryx.
My dataset has a City column, ID column (grouped), and a variance column. The target to calculate is the real 'variance to add' per station.
For all ID #1: the 'variance to add' is the variance as given.
For ID #2: the variance minus the 'variance to add' on row 1, but if this results in a negative number, the variance should be 0
For ID #3 the variance minus the sum of the 'variance to add' from ID 1 & 2, but if this results in a negative number, the 'variance to add' should be 0.
Essentially, it takes the variance of that record minus the running total of the 'variances to add'. If this results in a negative number, replace with 0.
Attached I have the Excel logic with formulas whereas the highlighted yellow column is the target output. Any idea on how to translate to Alteryx?