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

Sorting data by dimensions


There are usually two types of sorting requirements in reporting: one is to sort by numeric measures and the other is to sort by dimension members alphabetically.

Data from SSAS is naturally sorted by attributes in dimensions. Members in an attribute can be sorted by its own key or name value or sorted by another attribute's key or name value. The two properties that are related to member sorting are OrderBy and OrderByAttribute.

For example, if we put all members from the Date attribute on the ROWS axis, the results will already be sorted in ascending order of the date. This is because the Date attribute is sorted by its key value in the cube.

[Date].[Date].[Date].MEMBERS 

If we CROSSJOIN multiple sets, as shown in the following code snippet, the result will be sorted in ascending date order, then by customer name, and then by subcategory. In this case, the position of the set matters. The sorting order will be from left to right in ascending order.

[Date].[Date...
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