3 Replies Latest reply: Mar 22, 2017 3:04 PM by Sunny Talwar

# Set analysis, 12 months prior with p() function

Hi,

I have a table with the following column / measure:

Sum({\$<[Order Ship MonthID]= p(MonthID), [Order Create MonthID]= p(MonthID)   >}Orders)

That is working perfect for what I want. Now I want to have the values from 12 months prior next to it.

I tried something like:

Sum({\$<[Order Ship MonthID]= p(\$(MonthID)-12), [Order Create MonthID]= p(\$(MonthID)-12)  >}Orders)

Is it possible to have a calculation for all values in p()? What would be the syntax?

• ###### Re: Set analysis, 12 months prior with p() function

May be create a new field in the script

and then try this

Sum({\$<[Order Ship MonthID]= p(PrevMonthID), [Order Create MonthID]= p(PrevMonthID)>}Orders)

• ###### Re: Set analysis, 12 months prior with p() function

Hi Sunny, Good idea, I tried it but it plots the values not on the same line in that case. It just brings in the period of 12 months prior. I guess this makes sense, but I'd like to Jan 2017 with the values of Jan 2016 next to it. Any idea?

I would like to keep the months continuous and not discrete!

• ###### Re: Set analysis, 12 months prior with p() function

There is few ways you can handle this

1) Use The As-Of Table or