Forum Discussion

Mustafa_A's avatar
Mustafa_A
Contributor II
3 years ago
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.

 

Thank you,

Mustafa

  • 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

  • db_pdx's avatar
    db_pdx
    Valued Contributor

    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

    • Mustafa_A's avatar
      Mustafa_A
      Contributor II

      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.

       

  • kmdyda's avatar
    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

    • Mustafa_A's avatar
      Mustafa_A
      Contributor II

      Hi kmdyda 

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

       

      • kmdyda's avatar
        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's avatar
    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")

  • psc's avatar
    psc
    New Contributor III

    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's avatar
      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's avatar
        psc
        New Contributor III

        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!!