COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: tequila on 21 Apr 2014 02:45:06 PM

Title: Portal Report - current Year and last full month
Post by: tequila on 21 Apr 2014 02:45:06 PM
Hello,

I have a Crosstab as Portal Report. In the column i have months (Jan. Feb. Mar. .... December)
and in rows cities.

How can i do when i start the report it show only the current year (2014) and the fully month. E.g. Today is 21.04.2014. The crosstab only show worth of Jan. Feb. Mar. 2014 in the next month May 1,2,3,4 etc. Only the month december it show 1-11 and worth of days of 12. At the end i have aggregate of months.

I using two packages relational and dimensional.

Thnx
Title: Re: Portal Report - current Year and last full month
Post by: navissar on 22 Apr 2014 02:58:42 AM
Over relational, set a filter to something like this:
[year]=extract(year,current_date)
and
[month] <extract(month, current_date)
Make sure you use a numeric month field (if you don't have one you can calculate one).
Over dimensional, slightly different approach. This depends on how your time hierarchy is built. For instance, this calculation will return last 3 months up to but not including this one over a package where the last month available is the current month (no future data):
except(
descendants (lastChild ([All member of time hierarchy]),[cube].[time dim].[time hierarchy].[Month level]),
tail (descendants (lastChild ([All member of time hierarchy]),[cube].[time dim].[time hierarchy].[Month level]),1))