COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: Steve on 26 May 2021 01:50:33 PM

Title: Change value of Date prompt
Post by: Steve on 26 May 2021 01:50:33 PM
Hi Folks

I have a report using data from a cube and the report has a Date prompt. Problem is the Date prompt defaults to today and when the user runs the report, the report shows 'No Data available' because the cube does not have data for today, it has data till yesterday. I tried using If then else statements but that's not allowed when using MDX. This is my MDX in the data item to filter:

item( filter( [CubeName].[D_Date].[Date].[Date], caption([CubeName].[D_Date].[Date].[Date]) = # sq ( prompt( 'pDate', 'token',sq($Yesterday{'Key'} ) ) #  ) , 0)

where Yesterday is a parameter map with a value for yesterday's date.

Is it possible to use some condition so that I can replace the prompt value with yesterday's date? or is it possible to override the parameter value with Yesterday's date if the date chosen is today?