Analysis Services

Using WITH to Create Caches

As with named sets and calculated members, the WITH keyword is also used to create query level caches, usable for the lifetime of a single query. The following syntax is used to add the WITH keyword to the MDX SELECT statement:

[WITH <formula_specification>]
      [, <formula_specification>]
SELECT [<axis_specification>
       [, <axis_specification>...]]
  FROM [<cube_specification>]
[WHERE [<slicer_specification>]]

The <formula_specification> value for caches is further broken out in the following syntax definition:

<formula_specification> ::= CACHE AS '(<set>[, <set>...])'

The <set> value is the set expression used to create the cache. The <set> value can support the use of MDX set functions.

When using the <set> set expression for constructing a cache, the following rules apply: