Implementing unary operators

Unary operators are a way to bypass custom rollups in parent-child dimensions. Custom rollups, either built-in or the ones we created one recipe before, use MDX expressions to calculate the value of a member that has it defined. Unary operators use a simple character, most commonly a +, -, or ~ sign to instruct SSAS how that member aggregates into its parent. A plus means it is added, minus subtracted, and ~ means it doesn't aggregate at all.

Look at the last screenshot in the previous recipe. Item # of Orders is the aggregated value of two of its children. However, all three of them, that item and its children have MDX expressions that tell which value to display. We can simplify this. Instead of specifying an MDX ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.