COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: lalitha.nov20 on 27 Nov 2015 01:00:42 AM

Title: Running count in DMR model
Post by: lalitha.nov20 on 27 Nov 2015 01:00:42 AM
Hi All,

I have scenario, where i need to display only last 70 period from the current date. Also, i need a running count of those date. Can this be done in DMR .

Here is syntax i have used to get the last 70 periods from the current date.

except(lastperiods(70,item(filter(
[Labor].[Date].[Fiscal Week].[Fiscal Week],
[Labor].[Date].[Fiscal Week].[Fiscal Week].[Current Date Flag]='y'),0)),
lastperiods(1,item(filter(
[Labor].[Date].[Fiscal Week].[Fiscal Week],
[Labor].[Date].[Fiscal Week].[Fiscal Week].[Current Date Flag]='y'),0)))

I tried using the below scripts, but it always return 69, does not show the running count. It shows over all count.  >:(

total(1 within set except(lastperiods(70,item(filter(
[Labor].[Date].[Fiscal Week].[Fiscal Week],
[Labor].[Date].[Fiscal Week].[Fiscal Week].[Current Date Flag]='y'),0)),
lastperiods(1,item(filter(
[Labor].[Date].[Fiscal Week].[Fiscal Week],
[Labor].[Date].[Fiscal Week].[Fiscal Week].[Current Date Flag]='y'),0)))
)

Thank you,
lalitha
Title: Re: Running count in DMR model
Post by: lalitha.nov20 on 30 Nov 2015 12:36:53 AM
Any thoughts on this...
Title: Re: Running count in DMR model
Post by: schrotty on 30 Nov 2015 01:06:37 AM
Hi,


You count everytime 69 members, because your Expression delivers a set of 69 members.

You Need to generate a more dynamic set  e.g. running-total with periodsToDate http://www.ibm.com/developerworks/data/library/cognos/reporting/dimensional_queries/page563.html (http://www.ibm.com/developerworks/data/library/cognos/reporting/dimensional_queries/page563.html)


schrotty ;)