DSUM

Syntax

DSUM (Dimension, {Data}, {Condition})

Description

The DSUM function returns the sum of Data for the members in Dimension where Condition is True. If Condition is omitted, DSUM returns the sum of Data for all members in Dimension. If Data is omitted, DSUM returns the sum of the data cube being calculated for all members up to the current member in Dimension.

Example

Suppose that an analytic model contains a data cube called ADVERTISING_BY_PRODUCT and a data cube called UNITS_SOLD. Both data cubes use a dimension called PRODUCTS. Use the following formula to calculate the total units sold for all products:

DSUM(PRODUCTS, UNITS_SOLD)

The DSUM function does not include a condition, so the function computes the sum of UNITS_SOLD for all members in the PRODUCTS dimension. Use the following formula to calculate the sum of units sold for all products with advertising of at least 10000 USD:

DSUM(PRODUCTS, UNITS_SOLD, ADVERTISING_BY_PRODUCT >= 10000)

In this case, the function finds the sum of UNITS_SOLD only for the products where ADVERTISING_BY_PRODUCT is greater than or equal to 10000.

For an example of how to tabulate data for a series of ranges, see the entry for the DAVG function.

You can use the DSUM function without the Data argument to exercise complete control over the calculation of dimension totals for a particular data cube.

Related Topics