• subscribe
February 22, 2001 12:00 AM

February MDX Puzzle Solution Revealed

SQL Server Pro
InstantDoc ID #19941

Using the FoodMart or FoodMart 2000 Sales cube, determine the total profit for each of the top products (based on Unit Sales) for each member card type.

WITH SET CardTypes as 'CreatePropertySet([Store Type].
	[All Store Type], [Customers].[Name].Members, [Customers].
	CurrentMember.Properties("Member Card"))'
SELECT CardTypes on COLUMNS,
 TopCount( [Product].[Product Name].Members, 1, [Unit Sales] ) on ROWS
FROM Sales
WHERE ([Measures].[Profit])

This query uses the CreatePropertySet() function to create a named set with calculated members for each type of member card. The query uses the TopCount() function to determine the product with the most Unit Sales, then displays Profit for this product and each member card type.



ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here