Skip to content

Latest commit

 

History

History
59 lines (45 loc) · 1.53 KB

File metadata and controls

59 lines (45 loc) · 1.53 KB
title - (Subtract) (MDX)
description - (Subtract) (MDX)
ms.date 02/17/2022
ms.service sql
ms.subservice analysis-services
ms.topic reference
ms.custom mdx

- (Subtract) (MDX)

Performs an arithmetic operation that subtracts one number from another number.

Syntax

  
Numeric_Expression - Numeric_Expression  

Parameters

Numeric_Expression
A valid Multidimensional Expressions (MDX) expression that returns a numeric value.

Return Value

A value with the data type of the parameter that has the higher precedence.

Remarks

Both expressions must be of the same data type, or one expression must be able to be implicitly converted to the data type of the other expression. If one expression evaluates to a null value, the operator returns the result of the non-null expression.

Examples

The following example demonstrates the use of this operator.

-- This member returns the increase or decrease  
-- in gross profit margin over a month.  
WITH MEMBER [Measures].[GPM Delta] AS  
 (  
(Measures.[Gross Profit Margin]) -   
([Date].[Calendar].CurrentMember.PrevMember,   
Measures.[Gross Profit Margin])  
  ), FORMAT_STRING = 'Percent'  
  
SELECT   
DESCENDANTS(  
[Date].[Calendar].[Calendar Year].&[2002],   
[Date].[Calendar].[Month]) ON 0,  
[Product].[Category].[Category].Members ON 1  
FROM  
[Adventure Works]  
WHERE  
([Measures].[GPM Delta])  

See Also

MDX Operator Reference (MDX)