I have a crosstab report (Cognos8) that compares values current YTD to prior YTD. The report has 2 prompts - ?Last Calendar Year? and ?Last Calendar Month? where Calendar Month is the month number. There are then 2 filters: Calendar Year >= (?Last Calendar Year?) and Calendar Month <= (?Last Calendar Month?). I want to display the values entered for the prompts in the report title with 'As Of MMM,YYYY'. This also means I would need to convert the Month Number to the Month Name, and add one year to the value entered in the Year Prompt. How would I display the prompt values, convert the month value and calculate the year value?
'As Of'+' '+
case ParamDisplayValue('Mth')
when '1' then 'JAN'
when '2' then 'FEB'
-----
-----
when '12' then 'DEC'
end
+','+
number2string(string2int32(ParamDisplayValue('Yr'))+1)
Replace Year & Month parameter as in your report. Hope it resolves?
Thanks
How am I inserting this code into the header - as a Query Calculation? I can insert the 'As Of:' as a Text Item, but am not sure how to insert the code.
Actually, I tried this code as a Query Calculation, but get the error that the function ParamDisplayValue is not supported (using DB2). :(
I believe that would be a layout calculation