Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to disregard the first two records of a selection?

Hello,

I have an expression that makes the cumulative calculation of 12 months, but need a similar analysis that always disregard the first two months of a contract and start to accumulate from the third month as shown below in the yellow column..

Accumulate.png

This is the expression to 12 months (Green column):

aggr(rangesum(above(sum({$<MONTH_YEAR,YEAR>}Val2),0,12)),MONTH_YEAR)

/

aggr(rangesum(above(sum({$<MONTH_YEAR,YEAR>}Val1),0,12)),MONTH_YEAR)

Thanks!

1 Solution

Accepted Solutions
Not applicable
Author

Thank You!

This part of the document solved my problem.

sum({<Month={'>=$(=max(Month)-2)<=$(=max(Month))'}>}Amount)

View solution in original post

4 Replies
Gysbert_Wassenaar

You could do it with an AsOf table like described in this document: Calculating rolling n-period totals, averages or other aggregations


talk is cheap, supply exceeds demand
sunny_talwar

PFA

expression used: =Rangesum(Above(If(RowNo() > 2, Val2, 0),0,12))/Rangesum(Above(If(RowNo() > 2, Val1, 0),0,12))

Best,

S

Not applicable
Author

Thank You!

This part of the document solved my problem.

sum({<Month={'>=$(=max(Month)-2)<=$(=max(Month))'}>}Amount)

Not applicable
Author

Thanks. It works great, too.