If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Running count in DMR model

Started by lalitha.nov20, 27 Nov 2015 01:00:42 AM

Previous topic - Next topic

lalitha.nov20

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

lalitha.nov20


schrotty

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


schrotty ;)