Home      Functions     Common Solutions      Contact     






MDX Functions:
 
MDX Functions

 
Common Solutions

Common Solutions
 
Resource Links

MDX Books
MDX Related Software
MDX Related Blogs
 
Other Links

Contact Us
 
Microsoft SQL Server Analysis Services Function Page
Function Name: Min
Category: Statistical
Description: The Min function returns the minimum value for a numeric expression within the supplied set.
Syntax: MIN( «Set»[, «Numeric Expression»] )
Technet Link: MDX Min Function




The query below returns the Sale Amount measure and the MinValue calculated member. The MinValue calculated member takes the minimum value for members of the Fiscal Year level in the Fiscal hierarchy of the Date dimension.
 
WITH
      MEMBER [Measures].[MinValue] AS
      MIN([Date].[Fiscal].[Fiscal Year].Members, [Measures].[Sales Amount])
SELECT
      {[Measures].[Sales Amount],[Measures].[MinValue]} ON COLUMNS,
      {[Date].[Fiscal].[Fiscal Year].Members} ON ROWS
FROM
      [Adventure Works]
 
 

 
The following query uses the Min function to return the value of the Product with the lowest List Price for each Product Subcategory.
 
WITH
      MEMBER [Measures].[MinMember] AS
      HEAD(ORDER([Product].[Product Categories].CurrentMember.Children, [Product].[Product].Properties("List Price"), ASC),1).Item(0).Name
      MEMBER [Measures].[MinValue] AS
      MIN([Product].[Product Categories].CurrentMember.Children, [Product].[Product].Properties("List Price"))
SELECT
      {[Measures].[MinMember], [Measures].[MinValue]} ON COLUMNS,
      {[Product].[Product Categories].[Subcategory].Members} ON ROWS
FROM
      [Adventure Works]
 
 

 
 

 
Copyright 2008 by MDXpert.com.
 
Terms of Use                              Privacy Statement
 
Site Powered By - WinHost.Com