If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Display System Date -1 , need to show Month and year

Started by jasp, 08 Apr 2011 09:15:28 AM

Previous topic - Next topic

jasp

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

kattaviz

Hi,

Try using the _add_months(current_date,-1) and format this expression as per your requirements.

HTH
thanks & regards
Satish Katta

jasp

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) ".

kattaviz

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
thanks & regards
Satish Katta

jasp

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.

jasp

I used the below, it works, thanks for your help, much appreciated.

_add_months(date2timestamp(Today()),-1)