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

MAT Calculation

Hello all,

For MAT Calculation, I have written below expression which gives me incorrect results, any changes that can be made in it or some other expression has to be written?

sum({<YEAR={'=$(=only(YEAR)-1)'},MONTH={'>=$(=max(MONTH)-1)<=12'}>}VALUES)+

sum({<YEAR={'=$(=only(YEAR))'},MONTH={'>=1<=$(=max(MONTH))'}>}VALUES)

For ex, on selection of MArch 2014, my expression should calculate data Feb2013 onwards upto March 2014.

Thanks

1 Reply
richard_cioci
Creator
Creator

Hi aditi1617,

I would suggest creating an MAT field within the calendar table that already specifies which dates are part of each MAT. Then you could simply have those informing your expressions.

I'm actually going to do this right now, and I'll edit my post with the code in a bit. Although if you just want it done through an expression so it is based off your current selection, then hopefully someone can check your code.