COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: oscarca on 11 Jan 2019 02:34:19 AM

Title: Cast & substring date prompt olap
Post by: oscarca on 11 Jan 2019 02:34:19 AM
Hey Cognoise,

I have a data item that looks like this:
[Sales Analysis].[Time].[Month Hierarchy].[Date YYYYMMDD]->?PrmInvoiceDate?

Is it possible to directly cast and substring this expression like: substring(cast([Sales Analysis].[Time].[Month Hierarchy].[Date YYYYMMDD]->?PrmInvoiceDate?;varchar(8));1;6) to get the first 6 characters or do you have to do it another way like creating a new data item and do all the casting and substring first then placing it in the detail filters ?

It seems that when I create a new data item Calling it "Date YYYYMM" with the following expression substring(cast([Sales Analysis].[Time].[Month Hierarchy].[Date YYYYMMDD];varchar(8));1;6)" and placing it in detail filters: [Date YYYYMM] = ?Date? the report becomes really slow compared to the ([Sales Analysis].[Time].[Month Hierarchy].[Date YYYYMMDD]->?PrmInvoiceDate? in the slicer.

Best regards
Oscar