Skip to main content
Contributor
Feb 15, 2022 6:49 PM UTC
Solved

How to grab Prior 6 months in CV

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

db_pdxAnswer
Contributor
Feb 15, 2022 10:23 PM UTC

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

10 replies

Newcomer
Feb 15, 2022 7:39 PM UTC

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

Contributor
Feb 15, 2022 9:18 PM UTC

Hi kmdyda 

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

Mustafa_A_0-1644959864104.png

 

Newcomer
Feb 15, 2022 9:31 PM UTC

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

Newcomer
Feb 15, 2022 7:41 PM UTC

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_pdxAnswer
Contributor
Feb 15, 2022 10:23 PM UTC

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

Contributor
Feb 15, 2022 10:32 PM UTC

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.

 

Member
Feb 22, 2022 4:19 PM UTC

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!

Contributor
Feb 22, 2022 4:34 PM UTC

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

Member
Feb 22, 2022 4:40 PM UTC

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