COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: MFR on 19 Jul 2011 02:05:02 PM

Title: conditional calculation can't be reused
Post by: MFR on 19 Jul 2011 02:05:02 PM
In ReportStudio, creating a report with two sales columns to compare two different periods.  The columns are as follows:
 
if ( [Customer Profitability View].[Customer Profitability].[Invoice Date] in_range ?Date1? ) then (
[Customer Profitability View].[Customer Profitability].[Sales] ) else (0)
and
if ( [Customer Profitability View].[Customer Profitability].[Invoice Date] in_range ?Date2? ) then (
[Customer Profitability View].[Customer Profitability].[Sales] ) else (0).

These columns work fine alone but when I try to put them in a calculation to figure % change, all I get is zeros.  (sales2 - sales1) / sales2

I have the same logic in place for units and using this in a % change calculation works fine.

Properties are all set the same for the two calculated % columns.  Any ideas or clues would be much appreciated.

Thanks
Title: Re: conditional calculation can't be reused
Post by: rockytopmark on 21 Jul 2011 11:43:59 AM
Hoping it is right under your nose...

Try formatting the [%Change] cell as % and with at least 1 decimal.  My hope is that it is actually working, but Cognos is rounding down to 0 because the value is so small.