O'Reilly logo

MDX with Microsoft SQL Server 2016 Analysis Services Cookbook - Third Edition by Sherry Li, Tomislav Piasevoli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using a new dimension to calculate the most frequent price

In this recipe, we're going to analyze the products and their prices. The requirement is to find the most frequent price, or Mode Price, in any context.

Finding the price for a particular product doesn't look like a problem. We can either read it in its properties if the price is available as a product member property, or we can calculate the average price based on the sales amount and the quantity sold.

Member properties are static and therefore choosing the first approach would be wrong. For example, the price in the form of the member property doesn't change in time or with the territory. What we need is a dynamic expression.

The other option is to calculate the average price, but that's ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required