0

Parameter: 13 months on a rolling basis or the whole year.

Hello everyone,

I would like to add a parameter to a report that allows me to show either the last 13 months on a rolling basis or the whole year.

However, if I include it in a parameter, it shows me all values from the periods, i.e. April 2024 - April 2025.
If I aggregate the values, I get the two options ("Rolling" and "Full year"), but the bar chart then logically only shows one column.

Does anyone have a solution?
Many thanks and best regards
Jona

 (Formulation for rolling)

 

 (Visual for rolling)

 

 (Formulation for the year as a whole)

 

 (Visual for the whole year)

2 replies

null
    • Global Architect
    • Mark_Oldfield.1
    • 3 days ago
    • Reported - view

    Hi 

    The approach you want to take is to employ the Switch function to switch between two lists, a parameter can then drive this

    Switch 

    The example I will take you through can be found on our Explore server here 

    You can find details on how to sign up to Explore here.

    In my example, I have a discover called 'SalesDiscover' which is driven by a parameter that shows me either 'This Year' or 'Rolling 13 months '

     

     

    to achieve this I have a list called 'Months - Switch List' which uses a Global Parameter called 'Month Parameter' to switch between two predefinded lists ( Current Months - Year and Last 13 Months) 

    This will give you the required interaction for your discover

    Additionally, I noticed that the lists you created were hard-coded to include the elements you wanted; this can be achieved more dynamically.

    If you look at my example, there is a list called 'Current Full Month', the purpose of this is to return me the current month based upon the PQL function CurrentPeriod

    I am getting the member from my date dimension [date].[date] that relates to the current date and finding the member [date].[date full month name] that it relates to by using a NonEmpty.

    With this set, I can then create a dynamic set that will return me the rolling 13 months required, which employs the Range command 

    To get the required 13-month range, I set the end period using an element from the 'Current Full Month' set. The start period is then determined by applying a Lag(12) to this same element.

    Likewise, with the Full year of months,  I have created a list called 'Current Months - Year'

    Here I use the FullYear PQL function, this returns all of the elements for a year for a relating to a member. This can be use then to provide the months required to represent the Full Year.

     

    I hope this helps 

     

    thanks

     

    Mark.

      • Jona_Loneke
      • 6 hrs ago
      • Reported - view

      Hi  
      Thank you very much for your help and the very detailed description of the implementation process.
      The switch between the two predefinded lists works now!

      Unfortunately, I could not make the functions more dynamic because the data does not come from an in-memory database, but from a cube from our core database. Do you maybe have an alternative mdx function?

      Again: thank you very much for your help!

      Jona

Content aside

  • Status Answered
  • 3 hrs agoLast active
  • 2Replies
  • 31Views
  • 2 Following