MDX code snippet Existing
Reposted from Thomas Ivarsson blog with the author's permission.
If you would like to see how many cities that have sold a certain bike model you can start trying to write something like this on the Adventure Works demo cube.
([Product].[Product Categories].[Product].&[575],[Measures].[Internet Order Quantity])> 0))
Descendants([Customer].[Customer Geography],[Customer].[Customer Geography].[Country]) on 1
From [Adventure Works];
([Product].[Product Categories].[Product].&[575],[Measures].[Internet Order Quantity])> 0).Count
Descendants([Customer].[Customer Geography],[Customer].[Customer Geography].[Country]) on 1
From [Adventure Works];
Select {[Measures].[Internet Order Quantity]} on 0,
(Filter([Customer].[City].[City],
([Product].[Product Categories].[Product].&[575],[Measures].[Internet Order Quantity])> 0)) On 1
From [Adventure Works];
([Product].[Product Categories].[Product].&[575],[Measures].[Internet Order Quantity])> 0))
Descendants([Customer].[Customer Geography],[Customer].[Customer Geography].[Country]) on 1
From [Adventure Works];
Thomas Ivarsson has been working with the MS BI platform since SQL Server 7 in 1999. Presently he is working in the telecom industry in Sweden, with a data warehouse based on SQL Server 2005. From 1999 to 2007 he worked as a consultant also on the three SQL Server BI platforms. During the latest years he has spent most of time on SSAS, Reporting Services, ProClarity and Performance Point. He also has several years experience of the ETL process with DTS and SSIS. During 2008 and 2009 he has been working with introducing data mining in his daily business to see patterns in a service network behaviours. His blog can be found here: http://thomasianalytics.spaces.live.com |
Tags: mdx