Finding the name of a child with the best/worst value

Sometimes, there is a need to perform a for-each loop to get the top or bottom members in the inner hierarchy for each member in the outer hierarchy. The Identifying the best/worst members for each member of another hierarchy recipe deals with exactly that kind of topic.

Following the theme of the recipes in this chapter of reducing the size of a report to a manageable level, in this recipe we will show you another possibility of how to reduce the size of the result – by showing not all the descendant members, but only the best child member. We will demonstrate how to identify the member with the best/worst value, only this time the member is not just from any other hierarchy, it will be from ...

Get MDX with Microsoft SQL Server 2016 Analysis Services Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.