CumSum with more than one variable<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Need some help here.
I have this script for Cumulative Summary of NetRoomRevenueWithoutVat column by Year.
I would like to add another or two variable let's say by Year and By Agency and By Location (could be character or numeric).
Thank you in advance
If( Row() == 1 | Lag( :Year ) != :Year,
:NetRoomRevenueWithOutVat,
Lag( :CumSumByYear ) + :NetRoomRevenueWithOutVat
)
Re: CumSum with more than one variableOhh I am sorry!!! Really Sorry!! I thought you are Michael Crotty Mixed the MS with MC
Thank you a lot!
Re: CumSum with more than one variableIt might. But what the optimal sorting would look like depends on the structure/hierarchy of your data. Only you can tell.
Btw, I'm not Michael...
Re: CumSum with more than one variableThank you Michael! Would this help? michael@jmp

Re: CumSum with more than one variableIf the table is adequately sorted, I think this formula could work:
If(Row() == 1 | Lag(Eval List({:Year, :Agency, :Location})) != Eval List({:Year, :Agency, :Location}),
:NetRoomRevenueWithOutVat,
Lag(:CumSumByYear) + :NetRoomRevenueWithOutVat
)