MDAC 2.5 SDK - OLE DB Programmer's Reference
Chapter 26: Mapping MDX to SQL Statements


 

Axis Expressions

Each axis specification results in an SQL SELECT statement, the select list of which has one column for each dimension oriented on that axis, and a RANK column, which represents the rank of a tuple on the axis. (Recall that sets are ordered in MDX.) For example, the axis specification

   CROSSJOIN({MSAccess, MSWord}, {Kansas, Buffalo, Topeka, USA, Canada}) 
      ON COLUMNS

will result in a SELECT statement that generates the following virtual table.

Note   This table can be joined with the MEMBERS table to yield the axis rowset.

Name1 Name2 Rank
Products.[All].Office.Access Geography.[All].USA.Kansas 1
Products.[All].Office.Access Geography.[All].USA.NewYork.Buffalo 2
Products.[All].Office.Access Geography.[All].USA.Kansas.Topeka 3
Products.[All].Office.Access Geography.[All].USA 4
Products.[All].Office.Access Geography.[All].Canada 5
Products.[All].Office.Word Geography.[All].USA.Kansas 6
Products.[All].Office.Word Geography.[All].USA.NewYork.Buffalo 7
Products.[All].Office.Word Geography.[All].USA.Kansas.Topeka 8
Products.[All].Office.Word Geography.[All].USA 9
Products.[All].Office.Word Geography.[All].Canada 10

The generation of the preceding table requires multiple SQL statements, which operate on the MEMBERS and LEVELS tables. The virtual tables generated by the intermediate SELECT statements are used as input to the subsequent SELECT statements. The section "Mapping Example" offers several examples that make this process clear.