COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: gosoccer on 09 Oct 2014 02:38:57 PM

Title: Report Author - OLAP and lastPeriods and CubeDataUpdatedOn
Post by: gosoccer on 09 Oct 2014 02:38:57 PM
I have a need to include in my Query-Slicer a way to get the last 30 days. Presently the following is working just fine but I have to change the Query to
check for the last 30 days based on the "CubeDataUpdatedOn".

The following Query fails with the error shown below so if anyone as a
way to do this, could you please share?

lastPeriods(30,#'[dsCubexxxx].[Time].[Time].[Day]->:[PC].[@MEMBER].['+timestampMask(CubeDataUpdatedOn([dsCubexxxx].[Time])
+']'#) 
Parsing error before  xxxxxx
QE-DEF-0459 - Exception Error.

Thank you in advance for your time.

Thx in advance for your time.
Title: Re: Report Author - OLAP and lastPeriods and CubeDataUpdatedOn
Post by: MFGF on 17 Oct 2014 08:46:24 AM
Quote from: gosoccer on 09 Oct 2014 02:38:57 PM
I have a need to include in my Query-Slicer a way to get the last 30 days. Presently the following is working just fine but I have to change the Query to
check for the last 30 days based on the "CubeDataUpdatedOn".

The following Query fails with the error shown below so if anyone as a
way to do this, could you please share?

lastPeriods(30,#'[dsCubexxxx].[Time].[Time].[Day]->:[PC].[@MEMBER].['+timestampMask(CubeDataUpdatedOn([dsCubexxxx].[Time])
+']'#) 
Parsing error before  xxxxxx
QE-DEF-0459 - Exception Error.

Thank you in advance for your time.

Thx in advance for your time.

Hi,

Wouldn't the current period in the cube reflect the same date as the cube update date?

MF.
Title: Re: Report Author - OLAP and lastPeriods and CubeDataUpdatedOn
Post by: gosoccer on 20 Oct 2014 01:08:27 PM
well,
Here is what I using now,

lastPeriods(2,#'[dsCube-XXXXX].[Time].[Time].[Day]->:[PC].[@MEMBER].['+timestampMask($current_timestamp,'yyyymmdd')
+']'#) 

So, the cube is done last Saturday (3 Days Ago). I need to get the query based on the last cube created which in this case is Sat and
not what the above statement is doing going back 2 days (I think?).

Thank you in advance for your time.