COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Carrickgorman on 17 Oct 2011 07:14:41 AM

Title: Average price in a Crosstab
Post by: Carrickgorman on 17 Oct 2011 07:14:41 AM
Hi All
OK so I have a District and a Product Category and €Value and a Volume  and I want the Average Price (Value/Volume).
So a list report would look like this:
District | Category    | Value | Volume | Avg Price
NW      | Shoes         | 100    | 10        | 10
SW      | Trousers     | 100    | 10        | 10
NE      | Runners      | 100    | 10        | 10
SE      | Socks          | 100    | 10        | 10
So the Calculation for the Avg Price is Value/Volume. I have done the checks to insure one or both aren't 0 before I do the division. All works fine in the List. I run the report and all  comes back as expected.
Now I want this in a crosstab.
So I highlighted the
District> clicked on Structure > Pivot List to Crosstab
and then run the report and it goes off in a tangent and doesn't come back.

I want something like this:

Avg Price   | NW     | SW     |  NW     |    SW
Shoes        | 10      | 10      |   10      |    10
Trousers    | 10      | 10      |   10      |    10
Runners     | 10      | 10      |   10      |    10
Socks         | 10      | 10      |   10      |    10

Can anyone help me do this?
Thanks and regards
:)
Title: Re: Average price in a Crosstab
Post by: leahmarie on 17 Oct 2011 01:30:06 PM
A tuple should be your best friend here:

value(tuple([value]))/value(tuple([volume]))

I would just try to build your own crosstab instead of using structure and put avg price as the default measure in the corner.