Cognos Analytics

 View Only

 Report - Detailed filter - Calculate dynamically a date

Yann MISSER's profile image
Yann MISSER posted Fri June 27, 2025 12:32 AM

Hello,

I am trying to create a specific detailed filter:

[YYYY].[XXXX].[DateCourte].[DateCourte] = ZZZZ

DateCourte is in the following format:

          "type": "calculated",
          "name": "DateCourte",
          "dataType": "string",
          "isDataTypeInferred": true,
          "expression": "format('Entete-Histo'[Date],\"dd/mm/yyyy\")"

If I replace ZZZZ by ?Param1?, the following dates are proposed as an input parameter : 01/02/2025, 01/03/2025...

=> everything is fine

However, I would like to calculate dynamically ZZZZ to be equal to current day less 1 year : for example, 27/06/2024.

As a consequence, each time I execute the report, the date is filtered on the current day less 1 year.

Is it possible?

Regards

Jeam Coelho's profile image
Jeam Coelho IBM Champion

Hello,

The function _add_years ( date_expression; -1) does not work for you?