You can find the percentage difference between two rows
or columns in IBM® Cognos® Insight by calculating the variance
percentage. The variance percentage calculation is the difference
between two numbers, divided by the first number, then multiplied
by 100.
About this task
The steps use forecast revenue and actual revenue for each
product line as example data.
Procedure
- Select the rows or columns that you want to use.
- Right-click the rows or columns and click Calculate,
and then click Custom.
The Calculation window
appears with a default expression in the Expression field.
- In the Expression field, create
the following expression: ['first_data_item']
- ['second_data_item'] / ['first_data_item']
* 100.
Tip: When you type ['
into
the Expression field, a list appears with the dimensions in your cube.
You can select the dimension from this list instead of typing it into
the Expression field. The same list will appear any time you type ['
.
For example, type the following expression: (['actualrevenue']
- ['forecastrevenue']) / ['forecastrevenue'] * 100.
- Under Calculation order, ensure
that Summarize first, then apply the calculation is
selected. This option means that Cognos Insight
performs the calculation on the total values. Choosing Apply
the calculation first, then summarize applies the calculation
to each row or column first, and then sums the calculation results.
- In the Name field, type Variance
Percentage.
- Click OK.
- To format the new calculated data to appear with a percentage
symbol, right-click a calculated cell and click Format
Measure measure_name.
- In the list of formats, click Number.
- On the Advanced tab, type % in
the positive and negative Suffix fields.