COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: starterdev on 25 Mar 2014 02:32:00 PM

Title: Crosstab Calculation- Gross Margin Calculation Wrong
Post by: starterdev on 25 Mar 2014 02:32:00 PM
Hi there,

I'm running into an issue where I'm trying to retrieve the gross margins for a particular subset of data, and also return the parent of each subset gross margin as well.

The individual items are fine and working, but the parent calculation is adding up the percentages, or returning a /0 error instead of returning the gross margin for the parent set.  For example
(All Part of Group A)
Product 1 Sales 10 Cost 8 GM 20%
Product 2 Sales 20 Cost 18 GM 10%
Product 3 Sales 10 Cost 9 GM 10%
Group A Total (should be ) Sales 40 Cost 35 GM 12.5%
Instead its returning Sales 40 Cost 35 GM 40%<--- Adding the Gross Margins of the previous numbers

Please help!
Title: Re: Crosstab Calculation- Gross Margin Calculation Wrong
Post by: Ammus1234 on 26 Mar 2014 02:43:14 AM
Try changing the aggregate function of the total data item to 'Aggregate'
Title: Re: Crosstab Calculation- Gross Margin Calculation Wrong
Post by: starterdev on 26 Mar 2014 01:11:39 PM
That did not work.  It was still showing the proper amounts for the Sales and COGS, but did not have the proper Gross Margin based off of that.
Title: Re: Crosstab Calculation- Gross Margin Calculation Wrong
Post by: starterdev on 26 Mar 2014 02:03:30 PM
I've added screen shots to show the issue.



Title: Re: Crosstab Calculation- Gross Margin Calculation Wrong
Post by: Ammus1234 on 27 Mar 2014 12:14:51 AM
See the attached sample report. Check the property of Aggregate data item.
Title: Re: Crosstab Calculation- Gross Margin Calculation Wrong
Post by: CognosPaul on 27 Mar 2014 02:26:01 AM
Check the solve order for GM data item. It should be set to 2, or a higher number than the solve order on the total rows.