Skip navigation

MDX Tip of the Month - 01 May 1999

Let's say you want to write an MDX query that shows sales for all hot beverage products for each month of the year. That task sounds simple enough, but what if you add and remove products from your product list each month? How would you write the query so you don't have to update it every time you update your list of products?

Here's a trick to help: Use the descendants or children function. This example query uses both of these functions.

SELECT Descendants(\[Time\].\[1998\],\[Time\].\[Month\]) ON COLUMNS,
	\[Hot Beverages\].Children ON ROWS
FROM Warehouse

Try running this query in the MDX Sample program. The descendants and children functions are powerful, and we'll cover them in detail in future columns.

TAGS: SQL Server
Hide 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.