MDX with SSAS 2012 Cookbook by 2013
Author:2013
Language: eng
Format: epub
Publisher: Packt Publishing
Leaf and non-leaf calculations
The examples in this and the previous recipe are somewhat complex from a technical perspective, but they are perfectly valid in many reporting requirements. From an analytical perspective, it is often required to get the count of existing members on a non-leaf level, such as at the subcategory level in our example.
When it's required to get the count of members on a leaf level, designing a distinct count measure using the dimension key in the fact table might be a better option. It will work by the cube design in SSAS; there is no code maintenance and it's much faster than its MDX counterpart. Therefore, look for a by-design solution whenever possible; don't assume that things should be handled in MDX just because this recipe indicated such. Chapter 7, When MDX is Not Enough deals with that in more detail.
When it is required to get the count on a non-leaf attribute, that's the time when MDX calculations and relations between hierarchies and dimensions come in to play as valid solutions. Because either you are going to include that higher granularity attribute in your fact table (not likely, especially on large fact tables) and then build a distinct count measure from it, or you can build a new measure group at the non-leaf grain, or you will look for an MDX alternative like we did in this example and the one in the previous chapter. Additionally, the non-leaf levels will typically, although not always, have much lower cardinality than the leaf level, which means that MDX calculations will perform significantly better than they would on a leaf level.
This section serves the purpose of a reminder when it comes to the choice between cube design and MDX calculations. Knowing the pros and cons you should be well on your way to make the right decision.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8303)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(6754)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(6730)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(6612)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(6395)
Driving Data Quality with Data Contracts by Andrew Jones(6341)
Machine Learning Model Serving Patterns and Best Practices by Md Johirul Islam(6104)
Learning SQL by Alan Beaulieu(5997)
Weapons of Math Destruction by Cathy O'Neil(5783)
Big Data Analysis with Python by Ivan Marin(5371)
Data Engineering with dbt by Roberto Zagni(4370)
Solidity Programming Essentials by Ritesh Modi(4020)
Time Series Analysis with Python Cookbook by Tarek A. Atwan(3878)
Pandas Cookbook by Theodore Petrou(3586)
Blockchain Basics by Daniel Drescher(3298)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2909)
Feature Store for Machine Learning by Jayanth Kumar M J(2816)
Learn T-SQL Querying by Pam Lahoud & Pedro Lopes(2798)
Mastering Python for Finance by Unknown(2745)
