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

Detecting a particular member in a hierarchy

We frequently encounter situations where we need to include or exclude a certain member in a calculation. Our first step is to determine whether the member exists in a hierarchy.

When iterating through a set of hierarchy members, at each step in the iteration, the member being operated upon is the current member. This recipe shows how to determine whether the current member in the query context is a particular member that we are interested in.

Getting ready

Start SQL Server Management Studio and connect to your SSAS 2012 instance. Click on the New Query button and check that the target database is Adventure Works DW 2012.

In this example, we're going to use the Product dimension. Here's the query we'll ...

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