Skip navigation

November MDX Puzzle Solution Revealed - 29 Oct 1999

Imagine that you have a simple grid showing the FoodMart Sales cube. The grid displays the quarters in 1997 across the columns and CA, OR, and WA down the rows. The user clicks CA to drill down. What's the easiest way to formulate this query?

SELECT \[1997\].Children ON columns,
DrillDownMember( \{\[CA\], \[OR\], \[WA\] \}, \{ \[CA\] \} )
ON rows
FROM Sales

Microsoft designed the MDX function DrillDownMember to meet this common need. The DrillDownMember, according to the OLAP Services product documentation, drills down the members in a specified set that are present in a second specified set. The DrillDownMember takes two sets and inserts the children of each member into Set2 after that member occurs in Set1, as Screen A shows. You can see how the code inserts all the \[CA\] children into Set1. The resulting set is then \[CA\], \[CA\] children, \[OR\], \[WA\]. The DrillDownMember and other similar functions (DrillUpMember, DrillUpLevel, DrillDownLevel, etc.) are useful if you need to build a simple OLAP browsing application.

TAGS: SQL
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish