I am struggling to get a rolling subtraction in Alteryx for column 'Volume Type I'. I am trying to take the value from 'Volume Type 1' (starting at 3000) and subtract it -100 into a new column while also then taking the new value from the previous row and doing a rolling previous row - 100. In Excel this is obviously easy because I could just drag and copy the formula down, but I am having trouble replicating using the multi row formula tool in Alteryx. Thanks!
Row | Volume Type 1 | Type 1 Usage in Gallons | Usage (New Column) |
1 | 3000 | 100 | Row 1 Volume Type 1 (3000) - 100 = 2900 |
2 | 3000 | 100 | Row 1 Usage (2900) - 100 = 2800 |
3 | 3000 | 100 | Row 2 Usage (2800) - 100 = 2700 |
4 | 3000 | 100 | Row 3 Usage (2700) - 100 = 2600 |
5 | 3000 | 100 | Row 4 Usage (2600) - 100 = 2500 |
Solved! Go to Solution.
@koreyfras see the attached solution
Thank you! This is exactly what I needed, but now I am having problems when I'm trying to apply it to a bigger subset of data.
I have multiple cities within the data set, and each has a different starting amount for Volume. Is there a way to get it to basically start over the calculation with each new city? See the table below for what I am hoping to replicate. I've attached the workflow and a screenshot.
City | Volume Type I | Type I Usage in Gallons | Usage |
AMA | 6000 | 100 | 5900 |
AMA | 6000 | 100 | 5800 |
AUS | 3000 | 100 | 2900 |
AUS | 3000 | 100 | 2800 |