Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).
Returns the maximum value of a numeric expression that is evaluated over a set.
If a numeric expression is specified, the specified numeric expression is evaluated across the set and then returns the maximum value from that evaluation. If a numeric expression is not specified, the specified set is evaluated in the current context of the members of the set and then returns the maximum value from that evaluation.
Analysis Services ignores nulls when calculating the maximum value in a set of numbers.
The following example returns the maximum monthly sales for each quarter, subcategory, and country in the Adventure Works cube.
WITH MEMBER Measures.x AS Max ([Date].[Calendar].CurrentMember.Children , [Measures].[Reseller Order Quantity] ) SELECT Measures.x ON 0 ,NON EMPTY [Date].[Calendar].[Calendar Quarter]* [Product].[Product Categories].[Subcategory].members * [Geography].[Geography].[Country].Members ON 1 FROM [Adventure Works]