Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description: This function is used to return a number that is calculated by aggregating over the cells returned by the set expression. If a numeric expression is not provided, this function aggregates each measure within the current query context by using the default aggregation operator that is specified for each measure. If a numeric expression is provided, this function first evaluates, and then sums, the numeric expression for each cell in the specified set.

Syntax:

Aggregate(Set_Expression [ ,Numeric_Expression ])

Return Type:
SCALAR

Parameters:

  • Set_Expression: It is a valid MDX expression that returns a set.

  • Numeric_Expression: A valid numeric expression is typically an MDX expression of cell coordinates that returns a number.

Example:

Code Block
languagejava
WITH MEMBER [Measures].[DC] AS
    Aggregate( [Customer].[Geography].[Country].&[Australia],
		[Customer].[Geography].[Country].&[Canada]
    )
SELECT  
    [Measures].[DC] ON COLUMNS,
    [Product].[Product Categories].Children ON ROWS
FROM
     [AdventureWorksMF]