SQL Server Training Course Portfolio

What Is Microsoft SQL Server?

SQL Server is Microsoft's server based Relational Database Management System (RDBMS) providing a robust, reliable  and scalable solution for live OLTP business applications data and historic OLAP reporting and analysis systems.

The PTR SQL Server Training Course Portfolio

Our portfolio of SQL Server training courses caters for all job roles within the data management, development, and data analysis business intelligence areas of interest.

MDX - Counting Members at a Hierarchy Level

Counting Members in an MDX Query

MDX is a challenging query language. It is completely different to the SQL query language despite having a SELECT statement!

MDX queries are all about hierarchies, measures and members and when it comes to carrying out tasks that are simple in SQL it may not be so simple in MDX.

Most of the time when we work with MDX queries we are interested in bringing out aggregate values that are stored in our cube, but occasionally we may want to derive values from the stored cube data.

MDX - Ranking And Ordering By a Measure Value

The following example is based on an Adventure Works cube and shows you how to create a measure that ranks countries according to sales revenue.

It implements the following MDX functions:

  • Rank
  • CurrentMember
  • Children
  • Order

Rank by Largest to Smallest

The MDX WITH MEMBER statement creates a temporary measure for the rank value based on total internet slaes in the calendar year 2006, and the associated SELECT part uses the rank to order the countries.