• subscribe
April 26, 2001 12:00 AM

May MDX Puzzle

SQL Server Pro
InstantDoc ID #20171

Using the FoodMart 2000 Sales database, determine which promotion caused the most unique customers to purchase products.



ARTICLE TOOLS

Comments
  • Vishwanathan Raman
    11 years ago
    Jul 02, 2001

    The solution to the problem is

    with 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

You must log on before posting a comment.

Are you a new visitor? Register Here