In most cases an MDX SELECT statement is used to retrieve data from a SQL Server Analysis Services cube. Let Chris Webb introduce this important statement to you in this free, 20-minute video. Log-in or get a free account to watch it!
A simple MDX SELECT statement consists of a SELECT clause and a FROM clause. The SELECT clause uses sets to define what appears on rows and columns in a query, while the FROM clause contains the name of the cube that you are querying. The set used on rows cannot contain members from hierarchies that appear in the set on columns, and vice versa. Sets of tuples can be used on any axis to give a nested, or cross-tabbed effect.
A query may also contain a WHERE clause. Unlike in SQL, the WHERE clause doesn’t directly filter what appears on rows or columns, instead it slices the data in your results. You can think of the WHERE clause as an invisible, extra axis that is one tuple deep. When a set is used in the WHERE clause, the results will show aggregated values for all of the members in that set. Rows or columns that only contain null values can be filtered out from your results by adding a NON EMPTY statement before the axis definition in the SELECT clause.
If you would like to learn Multidimensional Expressions with Chris, make sure to watch the remaining videos in our MDX online course.