MDX Documentation
Where Clause (standard MDX)

MDX where clause (aka. slicer).

Description

The MDX where clause even though sharing the same name as the SQL statement is fundamentally different.

A MDX WHERE clause reduces the scope of the query. The WHERE clause reduces the cube into a new 'sliced' cube, the slice being defined by the WHERE clause.


SELECT
[Measures].Members ON 0,
[Geography].[Geo].Members ON 1
FROM
[Sales]
WHERE
([Time].[Calendar].[Year].[2010])


In the previous query, only that section of the cube where the year is 2010 is used; the rest of the cube is ignored.

Tuples and sets can be used in a WHERE clause :


SELECT
...
WHERE
{([Geography].[Geo].[Spain],[Product].[icCube].[Personal]),([Geography].[Geo].[Switzerland],[Product].[icCube].[Corporate])}


See 'Where clause on a set of tuples' example for further explanation.

The where clause does not allow to use a hierarchy being used in one of the axis. SubQueries, which are similar, offer greater flexibility. The cost maybe slower performance.

See Also

Where Clause Exists Where Set Clause Exists SubQueries

Examples

Special Examples (errors, null, ...)

XMLA Properties

Find here the value of the XMLA properties when not specified otherwise.

icCube OLAP version: 2.5.1 13-May-2012 02:21:10 GMT