Hi Mark,
Thanks for your suggestion! I never knew we can do this on the list report header.
------------------------------
Mohamad Aiman Arif Mohamat Saat
------------------------------
Original Message:
Sent: Fri April 14, 2023 11:25 AM
From: Mark Fry
Subject: Date Format in Table List Header Using Report Expression
Hi,
I'm assuming this is a list report? I would be tempted to just unlock the structure of the report and add the "As at" and "(Official)" text as text items into the list column header. For the date, add a query calculation that does _add_months([your date item], -1), and drag this into the column header between the text items. You can then select the query calculation in the column heading and specify the data format to be just the month and year.


Cheers!
MF.
------------------------------
Mark Fry
Technical Consultant
Original Message:
Sent: Fri April 14, 2023 04:26 AM
From: Mohamad Aiman Arif Mohamat Saat
Subject: Date Format in Table List Header Using Report Expression
Hi All,
We are using IBM Cognos Analytics with Watson (11.2.0).
We have this date prompt which is used to filter the data. At the same time we have this requirement to get the date selected, minus 1 months from it and add some strings on the table header (basically get the months before the date selected and add strings in between). Can refer to attachment below for reference.
I know it's a bit long but here is how I do to get this value from the report expression:
'As at ' + date2string (timestamp2date(_add_months(date2timestamp(string2date(ParamValue('date_filter'))),-1))) + ' (Official)'
Instead of having the whole date, is there a way to get only Months and Year ( Mar 2023) ?
Your help is deeply appreciated.
Regards,
Aiman
------------------------------
Mohamad Aiman Arif Mohamat Saat
------------------------------