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

How to display week number correctly

Started by _jl_, 16 Apr 2013 01:01:40 AM

Previous topic - Next topic

CognosPaul

JL didn't want to share the report xml to the world, so he messaged it to me. The issue was simply that his time dimension contained two hierarchies, week and month, and the periodsToDate function was referencing the wrong one.

So it was
total(1 within set periodsToDate([sales_and_marketing].[Time].[Time - Months].[Year],currentMember([sales_and_marketing].[Time].[Time - Months])))

Since the crosstab node was referencing the Weeks hierarchy, currentMember returned the default member of the time-months hierarchy, which was the ALL member. Since the all member doesn't exist in the context of years, the set was empty and it would return 0 for each row. Simply switching the hierarchy reference to Time-Week was enough to fix it.

JL, the thing to remember with this solution is that the week numbers are based on the members in the week set feeding the crosstab node. So if you want to limit the weeks to the last four weeks, you would do that on the weeks set, not the week number data item.