Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 

 View Only
  • 1.  FIRST_DAY(((CURRENT_DATE) + (-1) YEAR)

    Posted Wed November 18, 2020 07:01 AM
    hey,
    can anyone please let me know meaning of following sentence.
    BETWEEN FIRST_DAY(((CURRENT_DATE) + (-1) YEAR)) AND CURRENT_DATE

    ------------------------------
    Priyanka Joshi
    ------------------------------

    #CognosAnalyticswithWatson


  • 2.  RE: FIRST_DAY(((CURRENT_DATE) + (-1) YEAR)

    Posted Wed November 18, 2020 07:33 AM
    It's not a format I'm used to, but looking at it I'd say it's trying to filter the date in your report from one year ago to today.

    ------------------------------
    Chris Turner
    ------------------------------



  • 3.  RE: FIRST_DAY(((CURRENT_DATE) + (-1) YEAR)

    Posted Wed November 18, 2020 07:46 AM
    I agree with Chris T. The Between command will provide a result(s)/value/qry based on the date ranges specified beyond the command.

    Can you provide more detail as to where this command is being applied or used?  


    Rick Stacy
    Computer Programmer/Analyst
    Telecom Division
    Holyoke Gas & Electric
    99 Suffolk Street
    Holyoke, MA 01040
    T- 413-536-9300 (enter 252 once the greeting begins)
    M- 413-875-5170
    rstacy@hged.com
     





  • 4.  RE: FIRST_DAY(((CURRENT_DATE) + (-1) YEAR)

    Posted Fri November 20, 2020 11:46 AM
    Edited by System Admin Fri January 20, 2023 04:15 PM
    "FIRST_DAY" is not a Cognos function, but it appears to be a vendor-specific one in IBM DB2 (see, https://www.ibm.com/support/knowledgecenter/SSCRJT_7.0.0/com.ibm.swg.im.bigsql.commsql.doc/doc/r0061474.html). What DB is your function running against?

    In any event, per the above, "BETWEEN FIRST_DAY(((CURRENT_DATE) + (-1) YEAR)) AND CURRENT_DATE" would mean FROM the first day of the current month one year ago TO the current day. For example, as I write this, today is 11/20/2020, so BETWEEN 11/1/2019 AND 11/20/2020 (including the start and end dates).

    ------------------------------
    Michael Walter
    Business Analyst
    TX HHSC
    Austin
    ------------------------------