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,
        \[Product\].\[AllProducts\].\[Drink\].\[Beverages\].
        \[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.