• subscribe
December 19, 2001 12:00 AM

January 2002 MDX Puzzle

SQL Server Pro
InstantDoc ID #23253

When creating a financial report such as an income statement, you need to display the subtotals (which are parent members of a dimension) at the bottom of the statement—after the details (which are children). You can use the MDX Hierarchize() function with the POST option to force parent members to appear after their children. The following example shows the Hierarchize() function on the FoodMart 2000 Sales cube:

WITH SET MySet AS '{CA,CA.Children,\[OR],\[OR].Children}'
SELECT Hierarchize(MySet, POST) ON Columns
FROM sales
WHERE [Sales Count]

How can you change this query to sort the set MySet in ascending order while making sure the parents appear after their children?



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