COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Dashboards => Topic started by: raghunori on 16 Jan 2024 07:17:59 AM

Title: Rolling 12 months calculation in Cognos Analytics
Post by: raghunori on 16 Jan 2024 07:17:59 AM
Hello Cognos SMEs.. Is it possible to add rolling 12 months calculation in Cognos Analytics Dashboard (Not report studio) based on month selection filter? I have a chart with X-axis showing Month-Year and Y-axis showing Headcount..so now we are in Jan 2024, so if i select Nov 2023, my x-axis should show Nov-2022 till Nov-2023 and y-axis headcounts accordingly..
Title: Re: Rolling 12 months calculation in Cognos Analytics
Post by: cognostechie on 16 Jan 2024 04:25:53 PM
Rolling 12 Months doesn't go by the month but by the Date. Today is Jan 16 2023 so rolling 12 months would be Jan 17 2023 to Jan 16 2024. You should be having a Date parameter. That being said, I don't like to use the Dashboard feature because of it's limitations so can;t answer for sure but if it allows then it would be as simple as this:

[Date] >= _add_months ( ?pDate?, -12) and [Date] <= current_date

You can also put this in the package and create a parameter with the same name as defined in the package.