Skip to content

Latest commit

 

History

History
62 lines (48 loc) · 1.58 KB

subtract-mdx.md

File metadata and controls

62 lines (48 loc) · 1.58 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic ms.custom
- (Subtract) (MDX)
- (Subtract) (MDX)
kfollis
kfollis
kfollis
02/17/2022
sql
analysis-services
reference
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)