Cognos Analytics

 View Only
Expand all | Collapse all

relative dates ( April 1st Year start calendar)

  • 1.  relative dates ( April 1st Year start calendar)

    Posted Thu January 26, 2023 04:43 PM
    Using the APRIL sample calendar for relative dates ( fiscal year starts 4/1) in a data module

    noticed that QTD figures were larger than my YTD.   The QTD calc is as follows ( unedited OOTB) 

    #$_this.parent.idForExpression# >=
    #queryValue($_this.parent.split.ref + '.dQuarter',
    $_this.parent.split.ref + '.TheDate = ' + $_as_of_date)#
    AND
    #$_this.parent.idForExpression# <= #$_as_of_date#   

    so it grabs the dQuarter value based upon todays "TheDate" as the LOWER bound. 
    so for January 26,  2023 the QTD filter is   .....  SomeDate between  1/1/2022 and 1/26/2023

    ( dQuarter starts even BEFORE dYear ?)
    Am I missing something ?  Help IBM  



    ------------------------------
    CogAdmin
    ------------------------------


  • 2.  RE: relative dates ( April 1st Year start calendar)

    IBM Champion
    Posted Fri January 27, 2023 03:15 PM
    This does seem to be an issue in their pre-packaged tables. The quarter should be in the same year as thedate provided the calendar is a Jan, Apr, Jul, or Oct calendar. I checked the calendars, and it looks like the ones that have issues are as follows:
    04. April 1 (1 quarter, Q4)
    05. May 1 (1 quarter, Q4)
    06. June 1 (1 quarter, Q4)
    07. July 1 (2 quarters, Q3-Q4)
    08. August 1 (2 quarters, Q3-Q4)
    09. September 1 (2 quarters, Q3-Q4)
    10. October 1 (3 quarters, Q3-Q4)
    11. November (3 quarters, Q2-Q4)
    12. December 1 (3 quarters, Q2-Q4)

    I downloaded the .csv files from the accelerator catalog and corrected them. I'm attaching the corrected versions here for you. You can replace the files in the Calendars > Source Files folder in your environment with the new ones and it should let the existing data modules work.

    OR

    You could add a new calculation (I called mine dQuarter_corrected) with this expression:
    case when dQuarter < dYear then _add_years( dQuarter, 1) else dQuarter end.
    Then, you'll have to update all the quarter and QTD filters (Prior Quarter, Current Quarter, Prior QTD, QTD, Same Quarter Last Year, and Same QTD Last Year) to use the new calculation.

    ------------------------------
    Jonathan McKnight
    5x IBM Champion
    Business Intelligence Analyst
    Nashville, TN
    www.linkedin.com/in/jonathanmcknight
    ------------------------------

    Attachment(s)

    csv
    FiscalCalendarMay1.csv   5.24 MB 1 version
    csv
    FiscalCalendarDecember1.csv   5.28 MB 1 version
    csv
    FiscalCalendarApril1.csv   5.24 MB 1 version
    csv
    FiscalCalendarSeptember1.csv   5.24 MB 1 version
    csv
    FiscalCalendarAugust1.csv   5.24 MB 1 version
    csv
    FiscalCalendarJune1.csv   5.24 MB 1 version
    csv
    FiscalCalendarJuly1.csv   5.24 MB 1 version
    csv
    FiscalCalendarNovember1.csv   5.28 MB 1 version
    csv
    FiscalCalendarOctober1.csv   5.28 MB 1 version