Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Unary Operators

In Multidimensional Expressions (MDX), unary operators perform an operation on a single operand, such as returning the negative or positive value of a numeric expression.

MDX supports the unary operators listed in the following table.



- (Negative)

Returns the negative value of a numeric expression.

+ (Positive)

Returns the positive value of a numeric expression.

The following example demonstrates the use of a unary operator to return the negative value of a measure:

   MEMBER [Measures].[NegDiscountAmount] AS
   -[Measures].[Discount Amount]
   {[Measures].[Discount Amount],[Measures].[NegDiscountAmount]} on COLUMNS,
   NON EMPTY [Product].[Product].MEMBERS  ON Rows
FROM [Adventure Works]
WHERE [Product].[Category].[Bikes]

In addition, MDX uses special unary operators to determine the aggregation operation performed by the RollupChildren function. For more information on these special unary operators, see Adding a Custom Aggregation to a Dimension.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft