# Calculation Contexts – A Scenario Walkthrough

Calculation Contexts:

A Webi report basically contains the business data as dimensions and their associated measures.

For eg : A report could display Quantity sold(measure) in a Year(dimension).

Basically, Measures depend on the combination of other rows or columns with which it is associated in a report.

They change dynamically based on the contexts they are placed. We can change these default context by using

calculation contexts and thereby control a measure.

Calculation contexts can be leveraged extensively to display the exact data with help of the aggregate functions

along with context operators.

A Scenario Walkthrough:

In one of my projects, I faced a scenario to display the measures  Cpu_Utilization  and Memory_Utilisation only

for their respective Date Code in the detail levels as shown in the below Table 1.

From Table 1 we can understand that each date code has multiple hour codes which in turn has two Sbc items

under it which gives the detail values of both the measures, But in the output we don’t need to display Hour_code

and Sbc columns.

Table 1:

By removing both  those Hour_code and Sbc columns I got the below output in an aggregated manner,

So, to attain both those measures in the detail manner with respect to date code without displaying  hour_code

and Sbc columns,I have contexed the measures for each hour_code and Sbc in every date code.

=Average ([MEMORY_UTILISATION] For Each ([HOUR_CODE]; [SBC])) In ([DATE_CODE])

=Average ([CPU_UTILISATION] For Each ([HOUR_CODE]; [SBC])) In ([DATE_CODE])

Below is the desired output table achieved after using the above contexts,