I am trying to use Multiple Row Calculation to create new fields. For example:
Day | Revenue | Cost |
1 | 100 | 50 |
2 | 200 | 80 |
3 | 500 | 350 |
4 | 600 | 400 |
Is there anyway I could create two new fields (Accumulated Revenue,Accumulated Cost) with one tool? thanks
Solved! Go to Solution.
@masterwu You can use the running total tool to do that. I've attached an example.
I'm also working on a multi-row multi-field tool which would do the trick as well. I'm trying to combine the multi-row and multi-field formula tools while also adding column syntaxing similar to the row syntaxing that the multi-row tool supports. I've demonstrated that as well in my example.
Since the running total comes packaged with Alteryx, that would be the better method in this case. The multi-row multi-field tool I've created is great for when there really isn't a good way to do it out of the box. For example, if you wanted to do anything other than a running sum (like a running product), I think the multi-row multi field tool I have would come in handy at that point.
You can use a summarize tool. If there is a grouping field, you can configure the calculation to total based upon that field (e.g. Store Number).
Select the Revenue field and add a SUM action for Revenue (Sum_Revenue).
Select the Cost field and add a SUM action for Cost (Sum_Cost).
The output from the summary tool will be:
Sum_Revenue,Sum_Cost
1400,930
Cheers,
Mark
Yes, by using the Multi-Row Formula Tool.
Never mind, @patrick_digan's Running Total Tool is a better approach. I had forgotten about it.