Cognos Analytics

 View Only
  • 1.  Date Filter on Cognos Dashboard

    Posted Mon March 13, 2023 09:47 AM

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



  • 2.  RE: Date Filter on Cognos Dashboard

    IBM Champion
    Posted Tue March 14, 2023 10:44 AM

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



  • 3.  RE: Date Filter on Cognos Dashboard

    Posted Wed March 15, 2023 03:54 AM

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



  • 4.  RE: Date Filter on Cognos Dashboard

    IBM Champion
    Posted Thu March 16, 2023 08:24 AM

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



  • 5.  RE: Date Filter on Cognos Dashboard

    IBM Champion
    Posted Thu March 16, 2023 10:51 AM

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



  • 6.  RE: Date Filter on Cognos Dashboard

    Posted Fri March 17, 2023 03:39 AM

    Hi Philipp,

    I tried your way and it works!

    Thank you so much!



    ------------------------------
    Mohamad Aiman Arif Mohamat Saat
    ------------------------------



  • 7.  RE: Date Filter on Cognos Dashboard

    Posted Fri March 17, 2023 03:29 AM

    Hi Robert,

    I think your way works if we have first of month and second of month in our data. Like my data currently only have 2nd of months so the quantity of 1st day will not be available

    Our goal is to let user select the date (which is month-year) so they can/compare get the total for first date and second date (lets say November-2022 and March-2023)



    ------------------------------
    Mohamad Aiman Arif Mohamat Saat
    ------------------------------