Chapter 3

Understanding MDX

What's in this chapter?

  • What is MDX?
  • MDX concepts
  • MDX queries
  • MDX expressions
  • MDX operators
  • MDX functions
  • MDX scripts
  • Restricting cube space/slicing cube data
  • Parameters and MDX queries
  • MDX comments

In Chapter 2 you ran a simple MDX query to retrieve data from Analysis Services. Building on that, in this chapter you learn the fundamentals underlying the MDX language to manipulate and query Analysis Services objects. You also learn about some advanced concepts, such as MDX operators and functions. This forms the basis for many of the subsequent chapters in this book.

SQL Server 2012 provides a sample Analysis Services project that demonstrates the majority of the Analysis Services features available from www.wrox.com to learn MDX. In addition, this chapter along with Appendix A provides you with examples of MDX queries based on the sample Adventure Works DW Multidimensional project updated for Analysis Services 2012. Some of the MDX queries you need to write to solve business problems necessitate the use of cube space restriction, empty cell removal, and parameterized queries — all concepts covered in this chapter.

What Is MDX?

Just as Structured Query Language (SQL) is a query language used to retrieve data from relational databases, Multi-Dimensional eXpressions (MDX) is a query language used to retrieve data from Analysis Services databases. MDX supports two distinct modes:

  • Expressions language: Define and manipulate Analysis Services objects and ...

Get Professional Microsoft SQL Server 2012 Analysis Services with MDX and DAX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.