Using OLAPQuery Functions

Use OLAPQuery functions to insert standard numeric functions in computed measure expressions. Numeric functions compute a new measure for each value associated with it. You can use two types of OLAPQuery functions in the OLAPQuery section:

The table below provides a quick reference to the commands available on the Query menu and lists any related shortcuts.

The following table lists the functions available in the OLAPQuery section.

Table 42. OLAPQuery Functions 

Function

Type of Function

Description

% of Column

Interactive Reporting

Calculates the value of the specified measure as a percentage of the total for the column.

% of Row

Interactive Reporting

Calculates the value of the specified measure as a percentage of the total for the row.

% of Total

Interactive Reporting

Calculates the value of the specified measure as a percentage of the total for all rows and columns.

% Change

Interactive Reporting

Calculates the percentage change of the specified measure for a particular dimension from the previous member in that dimension. For example, this function could be used to calculate the percentage change from sales from the previous year.

Absolute Change

Interactive Reporting

Calculates the absolute change of the specified measure for a particular dimension from the previous member in that dimension. For example, this function could be used to calculate the difference in sales from the previous year.

Avg

MDX

Calculates the average of the selected measure evaluated over the specified dataset.

Correlation

MDX

Returns the correlation of a dataset against two measures.

Count

MDX

Calculates the number of members for the specified dimension in the report.

Covariance

MDX

Measures the tendency of two values to vary together. Variance is the average of the squared deviation of a value from its mean. The covariance is the average of the values of the deviations of feature values from their means.

Linregpoint

MDX

Calculates the linear regression of a dataset and returns the value of “b” in the regression line y = ax + b.

Linregr2

MDX

Calculates the linear regression of a dataset and returns r2 (the coefficient of determination).

Linregslope

MDX

Calculates the linear regression of a dataset and returns the value of “a” in the regression line y = ax + b.

Linregvariance

MDX

Calculates the linear regression of a dataset and returns the variance that fits the regression line y = ax + b.

Max

MDX

Returns the maximum value of the selected measure evaluated over the specified dataset.

Median

MDX

Calculates the median value of the selected measure evaluated over the specified dataset.

Min

MDX

Returns the minimum value of the selected measure evaluated over the specified dataset.

Stdev

MDX

Calculates the standard deviation of the selected measure evaluated over the specified dataset.

Sum

MDX

Calculates the sum of the selected measure evaluated over the specified dataset.

Variance

MDX

Calculates the variance of the selected measure evaluated over the specified dataset.

  To apply a data function:

  1. Select OLAP, then Add Computed Item, and then click Functions in the Modify Item dialog box.

    The Functions dialog box is displayed.

  2. Select the Interactive Reporting Web Client or MDX function from the Functions list.

    A description of the selected function is displayed below the Functions list and explains the type of calculation the function performs.

  3. Select the measure.

    You can select any measure in the cube, not just a measure in the query. The Cube Hierarchy list shows the organization of the cube including both members and levels.

    Some functions require that you specify a second measure to perform the calculation. See the specific function if you are required to specify a second measure.

    The Count function requires no measure.

  4. Define the dataset to evaluate the function and click OK.

    To add a member or level to the dataset from the Cube Hierarchy list, select a member or level, and click Add.

    To remove a member or level from the dataset, select a member or level and click Remove.