7 Replies Latest reply: Jun 19, 2017 11:19 AM by Sunny Talwar

# Rolling 3 months problem when crossing YEAR

Hi

This is common question here, I tried the solution discussed here, but it didn't work.

When single YEAR is selected, say 2017, previous year sales are not included in rolling sales.

I use the following formula to compute rolling sum of sales for last 3 months:

rangesum(

above(

aggr(

Sum( {< [Month]=,[Year]=>} Sales),

[Month] ),0,3)  )

It does not work.

Any idea?

Thank you!

• ###### Re: Rolling 3 months problem when crossing YEAR

Does your Month include Month and Year or just Month?

• ###### Re: Rolling 3 months problem when crossing YEAR

In this example - just Month as Dimension.

I also tried to make MonthYear as dimension, but it didn't work either

• ###### Re: Rolling 3 months problem when crossing YEAR

No in your Aggr() function's dimension

Try this may be

Aggr(RangeSum(Above(Sum({< [Month]=,[Year]=>} Sales), 0, 3)), (MonthYear, (NUMERIC)))

• ###### Re: Rolling 3 months problem when crossing YEAR

in my AGGR i tried both Month and MonthYear. Neither did work.

Your formula returns '-' in my table. Did you intentionally omit SUM before Aggr?

Aggr(RangeSum(Above(Sum({< [Month]=,[Year]=>} Sales), 0, 3)), (MonthYear, (NUMERIC)))

• ###### Re: Rolling 3 months problem when crossing YEAR

Moved the Aggr() to the most outer function, yes... is that what you question was? Can you share a sample to check this out?

• ###### Re: Rolling 3 months problem when crossing YEAR

Yeah, it worked.

I placed the "(" bracket in the wrong place at first. Thank you!

• ###### Re: Rolling 3 months problem when crossing YEAR

Super... please close the thread if you got what you were looking for.

Best,

Sunny