Skip to main content
Member
Jan 27, 2024 12:28 AM UTC
Solved

dynamic time period member list

I would like the use one of the T#Global function and create a dynamic time list for the last 24 months.  For example, I had the time as 2023M12, the list would show me all the months of 2023 and 2022.  Anyone has any tips on how this can be acoomplished?

Trung

Employee - Sage
Jan 29, 2024 11:10 AM UTC

T#YearPrior1(|GlobalTime|)Period(|GlobalTime|).Prior11, T#Global.Prior12, T#Global

Let's examine it from the end. T#Global will be our current Global period, easy. Then we add the previous 12 periods with .Prior12. That gives us 13 months, so we want the previous 11; to do that, we "rollback" to the same period (e.g. Dec) in the previous year, with T#YearPrior1(|GlobalTime|)Period(|GlobalTime|), and we use that as a reference to get the previous 11 periods.

This will give you the previous 24 periods inclusive.

3 replies

Employee - Sage
Jan 29, 2024 11:10 AM UTC

T#YearPrior1(|GlobalTime|)Period(|GlobalTime|).Prior11, T#Global.Prior12, T#Global

Let's examine it from the end. T#Global will be our current Global period, easy. Then we add the previous 12 periods with .Prior12. That gives us 13 months, so we want the previous 11; to do that, we "rollback" to the same period (e.g. Dec) in the previous year, with T#YearPrior1(|GlobalTime|)Period(|GlobalTime|), and we use that as a reference to get the previous 11 periods.

This will give you the previous 24 periods inclusive.

trunningAuthor
Member
Jan 29, 2024 6:54 PM UTC

Jack, 

You are a rockstar.  Thanks for the explanation. I was able to take it a step further and added an extra year!

T#YearPrior2(|GlobalTime|)Period(|GlobalTime|).Prior11,T#YearPrior1(|GlobalTime|)Period(|GlobalTime|).Prior11, T#Global.Prior12, T#Global

The beauty of this is now this is always dynamic and I never have to maintain it.   

Trung

Newcomer
Feb 7, 2024 1:12 PM UTC

The above thread is very userful.

I have another requirement. I want to  build a data buffer to include data records of an account and all the periods ( M1 to M12) of the POV year dynamically ? thanks in advance.