Original Message:
Sent: Thu March 16, 2023 10:50 AM
From: Philipp Hornung
Subject: Date Filter on Cognos Dashboard
Hi Mohamad,
Robert has been faster, so I can only sketch an alternative approach using the IBM sample data module with a dynamic rank function. Hope it helps.
Best regards,
Philipp
P.S. I'll be on parental leave from now on for one month, so I won't respond in case of questions


C_Quantity_Delta := C_Quantity_Latest - C_Quantity_Latest_1
C_Quantity_Latest-1 := case when C_Year_Month_Rank = 2 then Quantity else 0 end
C_Quantity_Latest := case when C_Year_Month_Rank = 1 then Quantity else 0 end
C_Year_Month_Rank := rank ( distinct C_Year_Month desc )
C_Year_Month := cast ( _year ( Date_ ) ; VARCHAR ( 4 ) ) + '-' + cast ( _month ( Date_ ) ; VARCHAR ( 2 ) )
------------------------------
Philipp Hornung
Business Intelligence Manager
Techniker Krankenkasse
Hamburg Germany
#IBMChampion
Original Message:
Sent: Thu March 16, 2023 08:24 AM
From: Robert Dostal
Subject: Date Filter on Cognos Dashboard
Hi Mohamad,
I tried a solution with my demo data which I'd like to show you here.
First of all I need two calculated columns for the first and second day of the time/date column. The first day is easy. Just create a new calculation based on your date column:
_first_of_month ( Date_ )
Then create a second calculation which refers to the just created one:
_add_days ( First_Date ; 1 )
I then added two calculations which filter the measure by the two created fields:
IF( Date_ = First_Date) THEN (Quantity) ELSE (null)
IF( Date_ = Second_Day) THEN ( Quantity) ELSE (null)
That's it with my demo data. Just drag the calculated measures into the KIP visualization and the data shows up. I just had to tweak a bit around my demo data as I don't have values on each 1st/2nd of each month:

Is this a solution that fits into your data model?
------------------------------
Robert Dostal
Team Leader BI
GEMÜ
Ingelfingen
Original Message:
Sent: Wed March 15, 2023 03:54 AM
From: Mohamad Aiman Arif Mohamat Saat
Subject: Date Filter on Cognos Dashboard
I have created this date filter, which we combine both month and year using this function "cast( MONTH_NAME , varchar(3)) + ' - ' + cast( Year_ , varchar(4))" (can refer to snapshot for the date filter). This is to get the non-consecutive date.

Now inside the cognos dashboard, we need to get the first and second date and create two different calculation and mapped to this column named "current_total". This is because we need to compare the total for first date and total for second date for this KPI chart.

Is there any suggestion on how we can achieve this?
------------------------------
Mohamad Aiman Arif Mohamat Saat
Original Message:
Sent: Tue March 14, 2023 10:43 AM
From: Philipp Hornung
Subject: Date Filter on Cognos Dashboard
Hi, Could you please provide some more details on what you are trying to achieve? Preferably with an example and/or screenshots?
------------------------------
Philipp Hornung
Business Intelligence Manager
Techniker Krankenkasse
Hamburg Germany
#IBMChampion
Original Message:
Sent: Mon March 13, 2023 04:35 AM
From: Mohamad Aiman Arif Mohamat Saat
Subject: Date Filter on Cognos Dashboard
Hi all,
Currently we are using IBM Cognos Analytics with Watson (11.2.0).
Is there a way to get two non-consecutive date and map the first and last date to two different calculation on the dashboard?
------------------------------
Mohamad Aiman Arif Mohamat Saat
------------------------------