COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: en1 on 29 Sep 2015 08:19:48 AM

Title: date compare (dimensional)
Post by: en1 on 29 Sep 2015 08:19:48 AM
Hi!
I have standart date dimension (hierarchy). How can select members (days) dates before '?start_date?'  without use filter function?
I try PeriodsToDate but its something other result.
Title: Re: date compare (dimensional)
Post by: en1 on 29 Sep 2015 08:59:16 AM
find function lastPeriods its Ok.
now cant find correct formula

this:

lastPeriods(1000, [#prompt('start_date','date')#])

not work  >:(
Title: Re: date compare (dimensional)
Post by: en1 on 29 Sep 2015 09:07:10 AM
i need to convert prompt date value  '2015-09-29' into member and then use lastPeriod function.
It is possible?
Title: Re: date compare (dimensional)
Post by: en1 on 29 Sep 2015 09:18:59 AM
#'lastPeriods(10, [' + prompt('start_date','token') + '])'#

work but wery slow  :(
Title: Re: date compare (dimensional)
Post by: MFGF on 29 Sep 2015 09:45:36 AM
Quote from: en1 on 29 Sep 2015 09:18:59 AM
#'lastPeriods(10, [' + prompt('start_date','token') + '])'#

work but wery slow  :(

This really shouldn't be slow - it is retrieving only 10 members, and directly from your cube. It ought to be far more efficient than a filter() function. Can you create a new report using this as a query calculation and see how it performs in isolation?

MF.
Title: Re: date compare (dimensional)
Post by: en1 on 29 Sep 2015 10:05:34 AM
Final version (maybe help somebody)

DataItem1
#
'[Cube].[Date].[Period].[Day]->:[PC].[@MEMBER].[' + prompt(
'paramDay',
'token',
'some default value') +
']'#

DataItem2
lastPeriods(10,[Data Item1])

work fast, in my case was problem on server java process use huge memory size




Title: Re: date compare (dimensional)
Post by: srinu_anu2007 on 29 Sep 2015 10:13:59 AM
Check if its useful.

lastPeriods (8,parent (#prompt('Param_Month','MUN','[rp_gcrs].[rp_period].[rp_period].[Month]->:[TM].[rp_period].[rp_period].[@MEMBER].

Thanks,
Title: Re: date compare (dimensional)
Post by: en1 on 29 Sep 2015 10:35:01 AM
it seems wrong results. i test lastPeriods on date 2009-01-01 and get 2011 year and 2012 year dates. Meanwhile function periodsToDate can be used and work fine.