COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: jayatu on 05 Aug 2015 01:52:09 AM

Title: Tuples for displaying data for Today & Yesterday
Post by: jayatu on 05 Aug 2015 01:52:09 AM
Hi,

I want to create a query that returns the values for Today & Yesterday side by side, something like

Object  | Today | Yesterday
Obj1     | 5        | 10
Obj 2    | 10      |  6

I am trying to achieve this using tuples as I am using a DMR model.

Please let me know how can I achieve this as the date functions like current_date does not work when used in a tuple.

The expression I used
tuple([Time (dim)].[Time].[Time].[Day]->current_date,[Sales (dim)].[Daily Sales])


Title: Re: Tuples for displaying data for Today & Yesterday
Post by: bdbits on 05 Aug 2015 12:07:05 PM
If you really want to base it off of the current system date, you'd need to construct a MUN I think. Syntax would depend on what the full MUN looks like from your time dimension. If you post that I could try to provide an expression.

Alternatively, there are dimensional functions to select time periods from a cube, e.g. lastPeriods() might work for you.