Contributor

How to read only 8 previous months data of current month.

Hi,

 

I have created a master time dimension setting module where my current month(Boolean line item) is selected as June 18.

 

I want all the 8 previous months value to be read by a second line item from an input module(second module having data for all period)

 

Amount(line item) should have the values of only 8 previous month starting from June 18 to backward till Nov 17.

 

 

Regards

Madhu

4 REPLIES 4
Community Boss

Re: How to read only 8 previous months data of current month.

@MadhabikaM ,

 

Can you use this?

 

If SYS Time.current month then movingsum(data,-8,0) else 0

 

https://help.anaplan.com/anapedia/Content/Calculation_Functions/All/MOVINGSUM.html

 

Hope this helps,

 

Rob

Highlighted
Contributor

Re: How to read only 8 previous months data of current month.

Hi @rob_marshall ,

 

Thanks for your quick response, the below formula give an error.

 

Can you please help me to enable Boolean check for previous 8 months periods from the current month.

 

Two line items created

Current month(Boolean)

Previous month enabled(Boolean)

 

If June 18 is checked as true, I want Nov 17,Dec 17,Jan 18,Feb 18,Mar 18,Apr 18,May 18 and Jun 18 also to be check enabled.

 

Regards

Madhu

Community Boss

Re: How to read only 8 previous months data of current month.

@MadhabikaM ,

 

This should work for you....create a line item formatted as boolean:

 

ITEM(Time) >= PERIOD(CURRENTPERIODSTART()) - 7 AND ITEM(Time) <= PERIOD(CURRENTPERIODSTART()) 

 

Hope this helps,

 

Rob

Community Boss

Re: How to read only 8 previous months data of current month.

As above, ensure that the formula is housed in your time settings module for optimal calculation efficiency

David