The Smart Guide to Building World-Class Applications
Thank you for recommending "SQL Server Pro is the leading independent community for DBAs and developers who build and manage Microsoft SQL Server database applications. ". Your recommendation has been successfully processed.
Friend 1
Using the FoodMart 2000 Sales database, determine which promotion caused the most unique customers to purchase products.
ARTICLE TOOLS
The solution to the problem iswith member [Measures].[CustomerCount] As 'DistinctCount(CrossJoin({Customers.[Name].Members},{[Promotions].CurrentMember}))' set [ResultSet] As '[Promotions].[Promotion Name].Members' member [Measures].[Result] As 'MAX([ResultSet],[Measures].[CustomerCount])'select {[Measures].[Result]} on columns,{Filter([Promotions].[Promotion Name].Members,[Measures].[CustomerCount]=[Measures].[Result])} on rows from sales