To use Cognos product documentation, you must enable JavaScript in your browser.

Item-based Calculations

You can create a calculation if you need a comparison or ratio that does not exist in the data source, such as actual revenue as a percentage of planned revenue, or the average revenue per employee.

You can perform the following arithmetic calculations in an analysis.

Arithmetic operationDescription
+ (sum)Adds the values of the selected items.
- (difference)Subtracts the values of one selected item from another.
* (product)Multiplies the values of the selected items.
/ (division)Divides the values of the selected items.
AbsoluteCalculates the absolute value of the numbers in the selected item.
RoundRounds the values in the selected item to the nearest integer.
Round downRounds the values in the selected item to the next lowest integer.
Square rootCalculates the square root of the values in the selected item.

You can perform the following percentage calculations in an analysis.

Percentage operationDescription
%Calculates the value of a selected item as a percentage of another item.
% of totalCalculates each value of a selected item as a percentage of the total.
% difference (growth)Calculates the difference between two items as a percentage.

You can perform the following analytic calculations in an analysis.

Analytic operationsDescription
AverageCalculates the average of values of the selected items.
MaximumCalculates the maximum value.
MinimumCalculates the minimum value.
MedianCalculates the middle value in a set of numbers.
Roll upCalculates the rolled up value.

You can perform the following ranking calculations in an analysis. By default, the highest value is ranked 1.

RankingDescription
RankCalculates the rank of each value.
PercentileCalculates a percentile, which is a value that corresponds to one of the equal divisions in a sample. For example, a score higher than 89 percent of those attained is in the 90th percentile.
QuartileCalculates a quartile, which is a value that corresponds to the 25% point in a sample. The first quartile is the 25th percentile, the second quartile is the 50th percentile, and the third quartile is the 75th percentile.
QuantileCalculates a quantile, which is a value that divides a sample into percentiles. For example, if the specified quantile is 5, the percentiles are 20, 40, 60, 80, and100.

Create an Item-Based Calculation

You can create a calculation if you need a comparison or ratio that does not exist in the data source, such as actual revenue as a percentage of planned revenue, or the average revenue per employee. The calculations available depend on how many columns or rows you select .

Calculation results are not stored in the underlying data source. Instead, Analysis Studio reruns the calculation each time you view the analysis. The results are always based on the most current data in the data source.

An item-based calculation that you create has no inherent aggregation rule. Because "sum" is the most common aggregation rule, Analysis Studio provides the "sum" aggregation rule to calculations so that the appropriate solve order occurs.

If you have several calculations in a crosstab, you should be aware of the default solve order .

Note: Cells show "--" (two dashes) rather than a value in calculations that use nonadditive measures such as count or average. Nonadditive measures are distinguished by a nonadditive measure icon  in the source tree.

Steps
  1. Select the rows or columns that you want to use in the calculation.

  2. Click the calculate  button on the toolbar.

  3. Choose whether to use a predefined calculation or create a member-based calculation:

  4. In the Operation box, click the operation you want to perform.

    Depending on the selected data, you may first need to choose an operation type from the Operation type box.

  5. Choose which data to use for the calculation:

  6. Click OK.

The calculated results appear in a new row or column after the last item used as an operand in the calculation.

Tips

Calculation Solve Order

When calculations in the rows and columns of a report intersect, Analysis Studio performs the calculations in the following order:

If both calculations have the same precedence, for example, if they are both business functions, then the row calculation takes precedence.

If you have the necessary permissions, you can open your analysis in Report Studio and override the order of precedence by changing the solve order property. For more information, see the Report Studio User Guide.

Rank Values

Ranking items identifies their relative position to help you compare data.

For example, you can rank a product line, such as golf equipment, to identify how well sales for golf equipment performed relative to other years.

You can also rank to identify how well sales for golf equipment performed relative to other products in the same axis.

Ranking operations include rank, percentile, quartile, and quantile .

If you use the default settings, you can rank values quickly by right-clicking a single row or column and clicking Rank.

Analysis Studio uses Olympic ranking for data sources.

The exception is that SAP/BW data sources use serial ranking.

Olympic ranking handles ties by assigning an equal rank to items with equal results. Serial ranking handles ties by assigning a sequential number to items in the order they are retrieved in the data source.

Team ResultsOlympic RankSerial Rank
Red 100 pointsRed 1Red 1
Green 50 pointsBlue 2Blue 2
Blue 75 pointsGreen 3Green 3
Yellow 50 pointsYellow 3Yellow 4
Orange 25 pointsOrange 4Orange 5

Steps
  1. Select a row or column to rank.

  2. Click the calculate button  on the toolbar.

  3. Click Custom.

    The Calculate dialog box appears.

  4. In the Operation type box, click Ranking.

  5. Choose the desired options under Operation, Available items, and Based on measure.

  6. Under Rank, choose whether to rank within the selected item only, or to rank with other values on the same axis.

  7. Click OK.

You can now sort the rank results to show them in numerical order.

Use Custom Ranking

By default, ranking is based on the innermost nested set and calculates the items that meet the filter criteria in the selected row or column. To calculate rank using different segments of the data or the outermost set, use custom ranking. For an example of custom ranking, see Example - Use Custom Rank.

Steps
  1. Select a row or column to rank.

  2. Click the calculate button  on the toolbar.

  3. Click Custom.

    The Calculate dialog box appears.

  4. In the Operation type box, click Ranking.

  5. Under Rank, click Custom.

  6. Choose the options that you want:

  7. Click OK.

You can now sort the rank results to show them in numerical order.