Search code examples
mdxolap-cubeiccube

How are OLAP-cube operations and MDX related?


I would like to understand how OLAP-cube operations (i.e. drilling up/down, slicing/dicing and pivoting) and MDX are related. My current guess is that OLAP-cube operations to MDX are like relational algebra to SQL. However, I do not see how some basic features of MDX correspond to OLAP-cube operations. For example, consider the following query on the demo "Sales" cube that comes with icCube:

SELECT {([Ottawa],[2009]), ([United States],[Feb 2010])} on Rows,
       [Measures].members on Columns
FROM [Sales]

How does the use of tuples (e.g. ([Ottawa],[2009])) correspond to an OLAP-cube operation?


Solution

  • Yes, "OLAP-cube operations are what visualization tools are expected to implement". MDX is the query language that is executed against a cube that produces a result. OLAP clients generally run MDX against a cube. "OLAP cube operations" as described in that wikipedia are usually as a result of a person performing adhoc analysis against a cube in an client application.

    Cube provide a structure and an access language that usually makes these types of operations easier (or at least faster)

    How does MDX relate to a "drill down" operation? for example?

    Firstly some MDX has already been run and yielded some kind of view of the cube (generally some rows, some columns, and a measure in the intersection although the MDX language syntax doesn't limit to two axes only).

    So a person sees this information and decides to drill down on a single item in the row (this item was previously returned by some MDX). So the OLAP client generates some MDX that provides the drilled down view on the item

    It might just add a children MDX function to the item in question. Or it might do it some other way. It depends on the client.

    Heres some introductory info on how you can eavesdrop on the interactions between an OLAP client (which one? doesn't matter) and a SSAS cube

    https://learn.microsoft.com/en-us/sql/analysis-services/instances/introduction-to-monitoring-analysis-services-with-sql-server-profiler