Sum

Returns the sum of values of tuples in a set.

Syntax

Sum ( set [,numeric_value_expression ] )

set The set containing the tuples to aggregate. If empty, the return value is #Missing.
numeric_value_expression Optional. An expression that returns a value. Commonly used to restrict the aggregation to a slice from a Measures dimension. In the example below, [Measures].[Total Expenses] is the numeric value expression provided to the Sum function.

Description

For each tuple in set, the numeric value expression is evaluated in that tuple's context and the resulting values are summed up.

The return value of Sum is #MISSING if either of the following is true:

Example

WITH MEMBER [Market].[Sum Expense for Main States]
AS
 'Sum
 ({[Market].[California], [Market].[Colorado],
   [Market].[Texas], [Market].[Illinois],
   [Market].[Ohio], [Market].[New York],
   [Market].[Massachusetts], [Market].[Florida]}, 
  [Measures].[Total Expenses]
  )' 
SELECT
 {[Measures].[Total Expenses]}
ON COLUMNS, 
  {UDA([Market], "Major Market"),
  [Market].[Sum Expense for Main States]}
ON ROWS
FROM 
 Sample.Basic
WHERE ([Scenario].[Actual])

returns the grid:

Total Expenses
New York 8914
Massachusetts 3412
Florida 5564
East 25310
California 11737
Texas 4041
Illinois 6900
Ohio 5175
Colorado 6131
Central 34864
Sum Expense for Main States 51874

©2004 Hyperion Solutions Corporation. All Rights Reserved.
http://www.hyperion.com