Hi All,
Some users have created some crosstab reports using current month from a time dimension this is a member, which automatically changes every month.
however when they run the report "Current Month" is displayed as text in the report and they would like to see for Example Apr 2010, and not the text "Current Month".
I know i have to select the cell and change the source type to Report Expression and use one of the functions. ie
string2date('2011-04-08') but this is not the current month as current month is the calendar month -1 .
Any suggestions on how to do this , also i would like it to be MM - YYYY being displayed.
thanks
Hi,
Try using the _add_months(current_date,-1) and format this expression as per your requirements.
HTH
hi katavitz
i tried that and i get
A parsing error was found at or near the position 24 in the expression "_add_months(current_date,-1) ".
Hi,
Create a query and in that query create a data item with the expression "_add_months(current_date,-1)". Then use this as singleton in your report to display the Current Month (Current Month-1 in your case). This did not gave me any errors.
What version of Cognos are you using and what is the DB?
HTH
i used your syntax , and instead of the report expression i used data item value and referenced it to the new data item, however on a simple report it works quite quickly on the user reports it just hangs.
Use Cognos 8.3 and its DMR.
Thanks for your help.
I used the below, it works, thanks for your help, much appreciated.
_add_months(date2timestamp(Today()),-1)