Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Links Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS SQL
Oracle
DB2
MS Access
MySQL
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» Sitemap
Free Newsletters:
DatabaseDaily  
News Via RSS Feed


follow us on Twitter
Database Journal |DBA Support |SQLCourse |SQLCourse2
 

Featured Database Articles

MS SQL

Posted Apr 17, 2003

MDX in Analysis Services: Intermediate Concepts - Part 1 - Page 2

By William Pearson

Cell Coordinates in MDX

MDX references specific cells in a way that embraces multidimensional concepts. The MDX notation system is fairly straightforward - with practice, one can easily read it in standalone form. Using a graphical illustration of a simple cube with three dimensions, we can express the coordinates (that is, the "address") for a cell in terms of the associated dimension intersect points. In Table 1, we represent a simple three-dimensional cube structure that displays the amount ("Actual" Amount) of expense incurred for the Los Angeles Store locations (in this case, a single store) of a grocery store chain, by expense account (Expense), over various time intervals (Time).

"Actual"

Expense

Time

Amount

Store
All

All

All

15333.08

Los Angeles

All

All

7472.88

Los Angeles

Net Income

All

(7472.88)

Los Angeles

Marketing

All

3960.00

Los Angeles

Marketing

Q2

960.00

Los Angeles

Marketing

June

320.00

Table 2: Illustration of a Cell "Address" in a 3-Dimensional Cube

To specify the location of the highlighted cell in the cube depicted above, we would provide an "address" that consists of one member for each dimension in the cube. The highlighted cell in Table 1 would be assigned the "address" (or coordinates in terms of the dimensions of the cube) shown below:

([Los Angeles], [Marketing], [Time].[All])

The "address" referring to a cell, such as the one above, or to groups of cells, is typically referred to as a tuple. Although a tuple must specify a member (used as a coordinate) for every dimension in the cube, we do not have to specify dimensions in cases where we mean to refer to the current member. The current member is assumed as a default in the majority of cases, unless we need to specify the dimension explicitly.

NOTE: As is the case in our Los Angeles example above, parentheses surround tuples that contain more than a single dimension in MDX notation.

We often work with MDX expressions that are made up of multiple independent values. We can use tuples from our cube, constants, or other values within our expressions, as we will see, to provide these values - values that we can then "fuse" to meet our requirements through the use of operators, such as "+", "-", "*" or "/" . We will gain experience manipulating values and operators in the next section, where we will illustrate these concepts by putting them into action.



MS SQL Archives

Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 




Latest Forum Threads
MS SQL Forum
Topic By Replies Updated
SQL 2005: SSIS: Error using SQL Server credentials poverty 3 August 17th, 07:43 AM
Need help changing table contents nkawtg 1 August 17th, 03:02 AM
SQL Server Memory confifuration bhosalenarayan 2 August 14th, 05:33 AM
SQL Server Primary Key and a Unique Key katty.jonh 2 July 25th, 10:36 AM


















Thanks for your registration, follow us on our social networks to keep up-to-date