Cognos Analytics

 View Only

 Cognos Report - Date calculation in a detailed filter

Anonymous User's profile image
Anonymous User posted Sun June 29, 2025 06:38 PM

Hello,

Right now, I have the following filter which is working well:

[DWH].[Table].[ShortDate].[ShortDate] = ?Param1?

When I launch the report, I am getting the following choice:

ShortDate column is defined as below:

          "type": "calculated",
          "name": "ShortDate",
          "dataType": "string",
          "isDataTypeInferred": true,
          "expression": "format('Table'[Date],\"dd/mm/yyyy\")"

The finality of my request is to replace ?Param1? by last year date (based on current date) same day, same week.

How is it feasable?

Regards

Jeam Coelho's profile image
Jeam Coelho IBM Champion

Hello,

_add_years(date , -1)

Anonymous User's profile image
Anonymous User

I tried : [DWH].[Table].[ShortDate].[ShortDate]=_add_years(date , -1)

I am getting the following error : XQE-V5-0011 V5 SYNTAX ERROR ... token " " detected after [ID-KPI].[Entete-Histo].[DateCourte].[DateCourte]=_add_years(date ,".