COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: charon on 19 Oct 2012 04:57:39 AM

Title: crosstab calculations
Post by: charon on 19 Oct 2012 04:57:39 AM
Hi cognoisers,

sad but true: im still not capable to get al calculations of cognos that i want :S

Following scenario: Crosstab with several facts as rows and columns with created data items for YTD, YTD-LY based on prompts for current year and month AND Columns for Percentage Calculations.

                    YTD               Ratio YTD              YTD-LY           Ratio YTD_LY
fact 1
fact 2
fact 3
fact 4

The challenge (for me ;): Ratio is calculated for every row, and the calculation is YTD (every row) against FACT1 (always against fact1)
so FACT 2(YTD) / FACT1(YTD)
    FACT 3(YTD) / Fact 1 (YTD)
    FACT 4 (YTD) / FACT 1 (YTD)

Ive tried sth _: creating a data item with 'curretn_measure within detail / fact1', set the aggregation to 'calculated'... is that the correct way?
Or are there other functions? ive searched the ibm documentation for RS functions, but didnt find it :S

Any ideas are appreciated, thx a lot and ..have a nice weekend (or IOD if youre there ;)
cheerz :P
Title: Re: crosstab calculations
Post by: Bark on 13 Nov 2012 11:25:25 AM
Is it a cube? If so:

[YTD] = aggregate(currentMeasure within set [setOfMonths]) <-- [setOfMonths] are the members of your year to date.
[YTD_Ratio] = aggregate(currentMeasure within set [setOfMonths]) / aggregate(currentMeasure within set [setOfMonths],[FACT1]) <-- where [FACT1] is the member from the cube.

Regards,

Bark
Title: Re: crosstab calculations
Post by: charon on 15 Nov 2012 04:50:27 PM
ty sir for replying :)