How to grab Prior 6 months in CV

Mustafa_A
Contributor II

Hi All,

 

I'm trying to display prior 6 months in my cube view. For e.g. if my WF time is 2021, I want the CV to show last six months in 2020 (Jun - Dec) and so on.

I tried using half year member filter, but it didn't work as it should. Any suggestions will be appreciated.

Mustafa_A_0-1644950863065.png

 

Thank you,

Mustafa

1 ACCEPTED SOLUTION

db_pdx
Contributor III

Probably lots of ways to build this, and it will vary based on you need (moving periods vs static periods).  A few potential solutions for static periods:

T#YearPrior1(|CVTime|)H2.Months

T#PovPriorYearM6.AllNextInYearInclusive

The documentation has good coverage on this area: Platform Guides > Design and Reference > Cube > Time Functions and Workflow References

View solution in original post

10 REPLIES 10

kmdyda
New Contributor II

Hi - Try the using this as your column member filter: T#Year(|CVTime|)PeriodPrior5(|CVTime|), adjusting the number after prior period to the appropriate number of months prior

Hi @kmdyda 

I tested it out. It pulls in YR 2016 instead of the ending six months. 

Mustafa_A_0-1644959864104.png

 

kmdyda
New Contributor II

Instead of |CVTime| try your |WFTime| as I'm guessing your Cube View POV is set to 2016 while WF POV is set to 2021

kmdyda
New Contributor II

Also, for a total column X number of periods back, take a look at the ViewXXMonthTotal, like in example below

"Trailing T#WF:V#Trailing12MonthTotal:Name("LTM")

db_pdx
Contributor III

Probably lots of ways to build this, and it will vary based on you need (moving periods vs static periods).  A few potential solutions for static periods:

T#YearPrior1(|CVTime|)H2.Months

T#PovPriorYearM6.AllNextInYearInclusive

The documentation has good coverage on this area: Platform Guides > Design and Reference > Cube > Time Functions and Workflow References

Thank you @db_pdx 

T#YearPrior1(|CVTime|)H2.Months worked!!   I just needed to replace CVTime with my own parameter.  

 

Will check it out. Appreciate it.

 

psc
New Contributor II

How would you do this if you wanted the month prior to that half year? For example I want to see december 2021 for the first 6 months in 2022, but in the second 6 months I want to see June?

 

Thanks!

Mustafa_A
Contributor II

So, you want to see HalfYear1 and HalfYear2 for prior years?

Using the solution from above. Try adding "HalfYears" variable.

T#YearPrior1(|CVTime|)HalfYears.Months

psc
New Contributor II

Not quite, I'd like the Dec 2021 I have here to dynamically either show December or June based on what part of the half year they are in. I'm using T#Global.MonthsInHalfYear for the columns after the highlighted. Thanks!!

paulacrisp_0-1645547947911.png

 

db_pdx
Contributor III

Hi paulacrisp: assuming your GlobalTime is an individual month, this should work:

T#FirstPeriodInHalfYearPrior1(|GlobalTime|)