MicroStrategy ONE

Sum

Returns the sum of all numbers in a list of values. This function is commonly used in metrics and subtotals. Sum is a group-value function.

Syntax

Sum <Distinct, FactID

Where:

  • Argument is an attribute, fact, or metric representing a list of numbers.
  • Distinct is a TRUE/FALSE parameter that allows you to calculate using all values in the list or only the unique values.
  • FactID is a parameter that forces a calculation to take place on a fact table that contains the selected fact.

Example

In this example, the metric Regional Revenue is defined as follows:

Sum(Revenue) {[Customer Region], ~}

This simple report uses the attributes Customer Region and Customer State, and the metrics Revenue and Regional Revenue to generate a report showing the sum of the revenue for several regions. A report filter limits the regions displayed to Northeast, Northwest, and Southeast.