Databases Reference
In-Depth Information
SELECT Measures.[Sales] ON COLUMS,
[Product].[Product Line].MEMBERS on ROWS
FROM ProductsCube
WHERE ([Product].[Color].[Silver])
The two columns selected in SQL are now on the axes COLUMNS and
ROWS. The condition in the SQL WHERE clause, which is a string comparis-
on, is transformed to an MDX WHERE clause, which refers to a slice on the
cube that contains products that have silver color. Even though the SQL and
MDX queries look similar, the operations in SQL Server and Analysis Ser-
vices are quite different.
Slicer Dimension
The slicer dimension is what you build when you define the WHERE state-
ment; it is a filter that removes unwanted dimensions and members. What
makes things even more interesting is that the slicer dimension then includes
any axis in the cube not overtly included in any of the queried axes. The de-
fault members of the hierarchies not included in the query axes are used in
the slicer axis. Regardless of how it gets its data, the slicer dimension will
only accept MDX expressions (described later in this chapter) that evaluate to
a single tuple. When there are multiple tuples specified on the slicer axis then
MDX will evaluate these tuples as a set and the results of the tuples are ag-
gregated based on the measures included in the query and the aggregation
function of that specific measure.
WITH Clause and Calculated Member
Often business needs involve calculations that must be formulated within the
scope of a specific query. The WITH clause in the MDX query provides you
with the ability to create such calculations within the context of the query. In
addition, you can also retrieve results outside the context of the current cube
identified using the LookupCube MDX function.
Typical calculations that are created using the WITH clause are named sets
and calculated members. In addition to these, the WITH clause also provides
you with functionality to define cell calculations, load a cube into an Analysis
Server cache for improving query performance, alter the contents of cells by
calling functions in external libraries, and additional advanced concepts such
 
Search WWH ::




Custom Search