Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Tips Database Forum Rss Feed

» Database Journal Home
» Database Articles
» Database Tutorials
MS Access
SQL Scripts & Samples
» Database Forum
» Slideshows
Free Newsletters:

News Via RSS Feed

Rss Feed

Database Journal |DBA Support |SQLCourse |SQLCourse2

Featured Database Articles


Posted Feb 9, 2004

MDX Essentials: Basic Set Functions: The Filter() Function

By William Pearson

About the Series ...

This is the sixteenth article of the series, MDX Essentials. The series is designed to provide hands-on application of the fundamentals of the Multidimensional Expressions (MDX) language, with each tutorial progressively adding features designed to meet specific real-world needs.

For more information about the series in general, as well as the software and systems requirements needed for getting the most out of the lessons included, please see the first article, MDX at First Glance: Introduction to MDX Essentials.

Note: Service Pack 3 updates are assumed for MSSQL Server 2000, MSSQL Server 2000 Analysis Services, and the related Books Online and Samples.

What We Accomplished in our Last Article

In the last article of the series, Basic Set Functions: The Except() Function, we explored the useful Except() function, whose purpose is to return the difference between two sets. In addition to discussing the purpose and operation of the Except() function, we focused on the treatment of duplicates by the function. We examined the syntax surrounding its uses, and illustrated its application in practice exercises, providing hands-on exposure to the use of Except().

We first undertook a multi-step example in which we exposed default handling of duplicates by the function, then explored an additional example where we practiced the use of the ALL flag to override the Except() function's default duplicate handling. Throughout the practice exercises, we discussed the results we obtained with each step's execution, remarking on the distinguishing characteristics of optional flag settings.


In this lesson, we will expose what many consider one of the most useful functions in the MDX arsenal, the Filter() function. The general purpose of the Filter() function is to allow us to filter out parts of a set that we do not need in a given situation, and to return a subset of a larger set as a result. Uses of the Filter() function, as with many MDX functions, can range from the sublimely simple to the impressively advanced, and it can be used in many innovative ways. The objective, of course, is the support of precise analysis to meet our business needs. We will see in this article how the Filter() function is a prime example of the efficiency and precision we can attain by using judiciously chosen functions from our MDX toolsets.

Along with an introduction to the Filter() function, this lesson will include:

  • an examination of the syntax surrounding the function;
  • illustrative examples of the uses of the function in practice exercises;
  • a brief discussion of the MDX results we obtain in the practice examples.

MS SQL Archives

Latest Forum Threads
MS SQL Forum
Topic By Replies Updated
SQL 2005: SSIS: Error using SQL Server credentials poverty 3 August 17th, 07:43 AM
Need help changing table contents nkawtg 1 August 17th, 03:02 AM
SQL Server Memory confifuration bhosalenarayan 2 August 14th, 05:33 AM
SQL Server Primary Key and a Unique Key katty.jonh 2 July 25th, 10:36 AM