COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: stevekoz on 13 Mar 2012 10:44:45 AM

Title: Suggest an Expression - %
Post by: stevekoz on 13 Mar 2012 10:44:45 AM
I've got a cross tab showing volume
as follows -


                            Total Actual Vol Sold |          Forecast Vol        |      Total by Item 1 |   
Location | Month                    1234                        1234                          1234
Location | Month                    1234                        1234                          1234   
Location | Month                    1234                        1234                          1234   

Total (Location)                    <1234>                   <1234>                     <1234>


I want to add a query calculation on to the end (next to Total by item 1) that gives % difference of Total Actal tonnes Sold.

Can anyone offer a suggestion of the expression i can use? The one i'm using total ([abc]) / total ([def]) isn't working and pulling back an sql error.

Title: Re: Suggest an Expression - %
Post by: wyconian on 14 Mar 2012 03:08:45 AM
Hi

What's your source?  If it's a cube or DMR you can use the value tuple function in the calculation, it would be something like

value(tuple([location | Month],[Total Actual Vol Sold])) / value(tuple([location | Month],[Forecast Vol]))

If you're reporting off a relational source it would be more difficult
Title: Re: Suggest an Expression - %
Post by: stevekoz on 14 Mar 2012 03:35:06 AM
hi, thanks for the information, i had tried a similar expression, but unfortunately it is a relational data source and not a DMR/Cube. Which is why its complicating matters some.