O'Reilly logo

MDX with Microsoft SQL Server 2016 Analysis Services Cookbook - Third Edition by Sherry Li, Tomislav Piasevoli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Passing parameters to an MDX query

In this recipe, we will consider two questions when passing parameters to an MDX query. One is the location of the parameters in the query, and the other is when to use STRTOMEMBER() function and when to use STRTOSET() function.

Where should we put the parameter(s) in the MDX query? We actually have the freedom to put them anywhere - in the WITH clause, on the COLUMNS and ROWS axes, in the WHERE clause, and in the subquery. In the previous recipe, Using a date calendar, we decided to put the parameters in the sub-query. In this recipe, we are going to expand that MDX query and add one more parameter on the ROWS axis. We will also move the date member parameter from the subquery to the WHERE clause.

The STRTOSET() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required