Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cross Tab Question

Status
Not open for further replies.

sunnykad123

Programmer
Joined
May 11, 2005
Messages
3
Location
US
I am using cognos8 report studio to generate a crosstab report. This is how I want the cross tab output to look like.
2006 2007 Diff
------------------------
Group1 10 8 2
Group2 12 3 9
Group3 9 1 8

I am unable to get the calculated column "Diff". Does anyone have any suggestions on how to get this result in a crosstab?

Thanks
Sunny
 
Sunny-
There may be a better way in C8, but in ReportNet I would union your 2006/2007 result set with one which selects the same data and calculates the difference. Put your existing tabular model in a tabular set with a second tabular model which contains your grouping data item, a text data item with the column value (i.e. 'Diff'), and a calculated data item something like diffvalue=(if (year='2007') then (value) else (0)) - (if (year='2007') then (0) else (value)), or some similar mechanism to flip the sign of the earlier year and then sum them. This assumes that you are always selecting only 2 years, and the hardcoded '2007' would of course be better as a parameter value or a maximum aggregation brought up from a child tabular model which just selects the year column. Hope this makes sense...
Steve
 
Hi,

If you are using a dimensional package in Cognos 8, this report becomes really easy. Simply drag in the members for 2006 and 2007 into the columns area, then add in a query calculation with the expression [2007] - [2006]. Is this kind of package available for you to use?

MF.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top