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 Dec 2, 2002

Introducing the SQL Server 'MDX in Analysis Services' Series - Page 5

By William Pearson


"Getting Familiar with the Membership" with MDX Expressions

MDX expressions can be used to retrieve information about members. The functions used can easily be added to our expressions from the Calculated Member Builder. As we've seen, expressions can return strings or numbers. We will explore the use of MDX to display member-related information; our exercises will demonstrate the concepts behind the workings of MDX.

The Functions tree of the Calculated Member Builder contains a list of many functions that are available within MDX. We can view the types of functions as the folders that compose the tree. Each folder name reflects the Category of return values (the types of values returned by the functions within the respective folder).

To illustrate, take the following steps:

  1. Select the Value property (go to Properties at the bottom left corner of the Cube Editor) once again for the MyCalcMem Calculated Member.
  2. Select the ellipses button.
  3. When the Calculated Member Builder initializes, clear the Value Expression box.
We can select functions to build our expressions in the Value Expression box. Functions are added to the Value Expression box by dragging the selected function to the box, by selecting the desired function and clicking the Insert button, or by double-clicking the desired function. A partial view of the Member folder within the Functions tree (expanded by clicking the "+" sign to the folder's left) is shown below.



Illustration 11: Partial View of the Functions Tree


We will demonstrate the way we use functions by taking the following steps:

  1. Expand the String folder in the Functions tree
  2. Double-click the UniqueName--Member function
  3. Click the <<Member>> token (a placeholder) in the Value Expression box, highlighting it, so that the Calculation Member Builder dialog looks like the illustration below.



Illustration 12: Highlight the <<Member>> Token in the Value Expression Box


As we are working with members, we now go to the Member folder within the Functions tree and expand it. (We can collapse the String folder by simply clicking the "-" sign to its left, to free up real estate).

  1. Expand the Member folder in the Functions tree.
  2. Double click the CurrentMember function.

A <<Dimension>> token appears in front of our expression in the Value Expression box, as shown below.



Illustration 13: The Value Expression Box, after adding the CurrentMember Function


  1. Click the <<Dimension>> token to highlight it, then double-click Product in the Data tree (to the left of the Functions tree) to change the expression to:

[Product].CurrentMember.Dimensions

  1. Click OK.


Page 6: MDX Expressions Continued


See All Articles by Columnist William E. Pearson, III




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