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

Help with Last Year last Month

Started by richiearora, 30 Sep 2013 05:54:04 AM

Previous topic - Next topic

richiearora

Hi,

I want to build logic in my report where Each month the Data is picked for Previous Month For Example.. Febrauary i would need January And for April i would need March.

I am able to filter them, However problem is with January when it has to be December Previous year.

Could you please help me write the case or if condition for same?

Gopinath

When your [Date] is '2013-Jan-01'

_add_months([Date], -1)  will give you  '2012-Dec-01'.





richiearora

Thanks Gopi, However my Measures have the Months as 1,2,3,4.. and So on ..

So that add months concept doesnt work for me

MFGF

How about:

CASE [Your month item] 
WHEN 2 THEN 1
WHEN 3 THEN 2
WHEN 4 THEN 3
WHEN 5 THEN 4
WHEN 6 THEN 5
WHEN 7 THEN 6
WHEN 8 THEN 7
WHEN 9 THEN 8
WHEN 10 THEN 9
WHEN 11 THEN 10
WHEN 12 THEN 11
WHEN 1 THEN 12
ELSE 0 
END
Meep!