Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
MDX with Microsoft SQL Server 2016 Analysis Services Cookbook

You're reading from   MDX with Microsoft SQL Server 2016 Analysis Services Cookbook Over 70 practical recipes to analyze multi-dimensional data in SQL Server 2016 Analysis Services cubes

Arrow left icon
Product type Paperback
Published in Nov 2016
Publisher Packt
ISBN-13 9781786460998
Length 586 pages
Edition 3rd Edition
Arrow right icon
Authors (2):
Arrow left icon
 Li Li
Author Profile Icon Li
Li
Tomislav Piasevoli Tomislav Piasevoli
Author Profile Icon Tomislav Piasevoli
Tomislav Piasevoli
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

MDX with Microsoft SQL Server 2016 Analysis Services Cookbook Third Edition
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Elementary MDX Techniques Working with Sets FREE CHAPTER Working with Time Concise Reporting Navigation MDX for Reporting Business Analyses When MDX is Not Enough Metadata - Driven Calculations On the Edge

Calculating various ranks


This is the final recipe in our series of relative calculations. In this recipe, we're going to show how to calculate the rank among siblings, the rank on a level, and the rank in the entire hierarchy. A good introduction is given in the first recipe of this series, Calculating various percentages. Therefore, it is recommended that you read all three recipes in this series in order to get a better picture of the possibilities and specifics of calculating relative percentages, averages, and ranks.

Getting ready

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

Here's the query we'll start from:

WITH 
MEMBER [Measures].[Level] AS 
   [Sales Territory].[Sales Territory] 
   .CurrentMember.Level.Ordinal 
SELECT 
   { [Measures].[Level], 
     [Measures].[Reseller Sales Amount] } ON 0, 
   { [Sales Territory].[Sales Territory...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images