COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: _jl_ on 22 May 2013 05:43:43 AM

Title: How to display yesterday's figures
Post by: _jl_ on 22 May 2013 05:43:43 AM
Hi,

How can I display only yesterday's data in a crosstab? The "Day" information (see attachment) is in '2013/05/21' format. I have tried several ways but wasn't able to get it to work. :(
Title: Re: How to display yesterday's figures
Post by: CognosPaul on 22 May 2013 07:11:56 AM
Is this DMR or a proper olap cube?

If it's a proper cube, open the members for the Day level, right click on one of them and take a look at the member unique name.

It might look something like:
[Cube].[Time].[Time].[Day]->:[PC].[@MEMBER].[20130522]

Since the key of the member is a simple yyyymmdd, building the mun is simple:
#'[Cube].[Time].[Time].[Day]->:[PC].[@MEMBER].['+timestampMask(_add_days($current_timestamp,-1),'yyyymmdd)+']'

Stick that into the slicer and it will filter the entire query.
Title: Re: How to display yesterday's figures
Post by: _jl_ on 24 May 2013 01:33:17 AM
Yes, member unique name is in that form.

I didn't get it to work, though. Did you mean I should just drag the item 'Day' from Data Items -list to "Slicer" list in the Query explorer. And after that, set an expression to that Day: #'[Cubename].[All Dates].[All Dates].[Day]->:[PC].[@MEMBER].['+timestampMask(_add_days($current_timestamp,-1),'yyyymmdd)+']'

If so, it's giving an error... Attached.
Title: Re: How to display yesterday's figures
Post by: CognosPaul on 24 May 2013 07:22:08 AM
You forgot the closing hash # at the end
Title: Re: How to display yesterday's figures
Post by: _jl_ on 19 Jun 2013 01:20:50 AM
It gives the same error even if I add the #-sign in the end.  :(

#'[Cube].[Time].[Time].[Day]->:[PC].[@MEMBER].['+timestampMask(_add_days($current_timestamp,-1),'yyyymmdd)+']'#

Ideas?

BR,
jl
Title: Re: How to display yesterday's figures
Post by: CognosPaul on 19 Jun 2013 04:10:32 AM
Parsing errors indicate problems with the code. Usually typoes or forgetting something. It looks like you also forgot the closing ' after the date format. 'yyyymmdd'
Title: Re: How to display yesterday's figures
Post by: _jl_ on 19 Jun 2013 04:51:57 AM
That's correct, working now. Thank you!

jl