Featured Database Articles

MDX Operators: The IS Operator - Page 4

Procedure: Use the IS Operator to Perform Comparisons
within the FILTER() Function

The
report authors / developers have an additional request which we can help them
to meet with the IS operator. This time, they wish to use the Filter()
function within a query which will allow them to focus upon Internet Sales
at a specific geographical level. While our colleagues have asked that we craft
the query to return the Internet Sales measure for customers within a
single U. S. state, Georgia, for Fiscal Year 2004, we confirm
their understanding that, given the core query, the capability to perform ad hoc
queries, where the information consumer is prompted at runtime for a state or
states (or members at other geographic levels, for that matter) becomes a simple
matter of parameterizing the unique name for the state, etc., within the Filter()
function we will place within the rows-axis specification of the query. Because
we have demonstrated to the developers, that parameterization of this sort
becomes easily attainable within Reporting Services, assuming that
sufficiently sophisticated queries are put into place to support it (within
either the Reporting Services or Analysis Services layers), the
core query is deemed valuable to the team.

In the returned dataset, we see that the query appears to
deliver the intended results: only those members of Customer Geography
whose parent is the State-Province of Georgia(the cities
of Georgia) are displayed.

8.
Select File
-> Save MDXQuery2.mdx As ..., name the file MDX045-002-1.mdx,
and place it in the same location used to store the earlier queries.

The
effect, as we see, has been to filter the results dataset to return only those
members that "pass" the conditional test enacted by the IS operator
within the Filter() function. That is, only those members who return a
"true" are included within the final results.

The
client representatives inform us that their immediate goals have been met, and
that the examples we have shared have illustrated the principles of operation
behind IS operator. We discuss related matters, such as
parameterization within Reporting Services, and make an appointment to
return to the client site at a future date to demonstrate the concepts.

Summary ...

In
this article, we shifted our examination from the MDX functions, as we
have upon occasion in the past, to concentrate upon an operator. We
introduced the IS operator, noting that, like other logical operators,
it evaluates values and returns a Boolean value. We explained that the IS operator's
utility lies in its capability to perform comparisons between objects within Analysis
Services.

After
discussing the straightforward purpose of the IS operator, to
ascertain the equivalence of two object expressions, we examined the manner
in which IS manages to do this, and ways we can leverage the operator to
perform efficient comparisons to meet various business needs in our own
environments. Next, we examined the syntax with which we employ IS.
Finally, we undertook illustrative examples whereby we put the IS operator
to work, both within the definition of a calculated member and, in conjunction
with the MDX Filter() function, within an axis specification of a SELECT
statement, to gain some hands-on practice in its use. Throughout our
practice session, we briefly discussed the results datasets we obtained
from each of the queries we constructed.

Advertiser Disclosure:
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.