Free Newsletters:
DatabaseDaily  
Database Journal
Search Database Journal:
 
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Links Database Forum DBA Videos
internet.com

» Database Journal Home
» DBA Videos
» Database Articles
» Database Tutorials
MS SQL
Oracle
MS Access
MySQL
DB2
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» DBA Jobs
» Sitemap

News Via RSS Feed



follow us on Twitter

Marketplace Partners
Be a Marketplace Partner

internet.commerce
Be a Commerce Partner


















Mariposa Bot Shipped With Vodafone Smartphone

IT Job Market Heating Up: Report

Bing Makes Strides But Momentum Stalls

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Database Journal | DBA Support | SQLCourse | SQLCourse2







Related Articles
MDX in Analysis Services: Retrieve Data from Multiple Cubes
MDX in Analysis Services: Intermediate Concepts - Part 2
MDX in Analysis Services: Intermediate Concepts - Part 1
Introducing the SQL Server 'MDX in Analysis Services' Series

Finance Developer (IL)
Next Step Systems
US-IL-Chicago

Justtechjobs.com Post A Job | Post A Resume

Featured Database Articles

MS SQL

July 22, 2003

MDX in Analysis Services: Measuring Change over Time

By William Pearson

Let's insert an argument to leverage further the flexibility of the expression.

16.  Return to the Value Expression box for the Parallel Amount calculated member.

17.  Place the following text between the parentheses for the argument that we discussed earlier:

[Year]

The completed expression should now appear as below:

(ParallelPeriod([Year]),[Amount])

18.  Click OK.

19.  Expand 1998 as we did for 1997 earlier, as shown in Illustration 29.


Illustration 29: Expanded 1998

20.  Drag the Parallel Amount calculated measure to the top of the calculated measures listed in the Cube tree, to make comparisons between Amount and Parallel Period easier (simply drag and drop Parallel Amount over the top calculated member to perform the desired substitution).

The relevant portion of the results appears as shown in Illustration 30:


Illustration 30: The Results with the Modified ParallelPeriod() Function

As we see above, the Amount value (at each level) now has a matching Parallel Amount in the respective reporting period of the previous year (except, obviously, where no data exists within the cube to be retrieved).

We will now conclude the lesson with the computation of a variance (often called a "delta" or, basically enough, "growth") between the current Amount and the Prior and Parallel Amounts. This is handled via a simple subtraction of one calculated member from another, as we see in the following steps:

21.  Double-click the Quarter dimension label once again, to zoom up - and free real estate for our next step.

22.   Select Insert (top menu). Select Calculated Member on the drop-down menu.

The Calculated Member Builder appears.

23.  Type Chg Over Parallel Period into the Member Name box.

24.  In the Value Expression box, type the following expression:

[Amount]-[Parallel Amount]

25.  Click OK to accept the expression entered.

Compare the result set to that partially shown in Illustration 31. Keep in mind the effects that are to be expected when dealing with debit / credit (+ or -) signs.


Illustration 31: The New Chg Over Parallel Period Column Appears

Notice that we did not have to set the format string for the new calculated member; it automatically assumed the format string of the two calculated members from which it was computed.

26.   Select Insert (top menu).

27.   Select Calculated Member on the drop-down menu.

The Calculated Member Builder appears.

28.  Type Chg Over Prior Period into the Member Name box.

29.  In the Value Expression box, type the following expression:

[Amount]-[Prior Amount]

30.  Click OK to accept the expression entered.

Compare the result set to partially shown in Illustration 32.


Illustration 32: The New Change Over Prior Period Column Appears

While the examples above restrict themselves to simple variances, percentage variances and a host of other embellishments might be added via a well-placed calculated member in the same general manner.

31.  Save the work accomplished in this session by selecting File -> Save from the top menu, as desired.

In conclusion, our efforts have shown the relative ease with which we can embed the concept of time within our MDX expressions to support the time-based analysis needs of Information Consumers, such as the quantification of change in values over time. The inherent grasp of hierarchical relationships that is integral to the design of MDX makes handling time members quite similar to handling members of any other dimension.

 

Next in Our Series ...

In this tutorial, we expanded upon the topics we introduced in our previous lesson, Retrieve Data from Multiple Cubes. We began the lesson with another integrated practice example, where we explored further the handling of hierarchical relationships in our expressions. We practiced using conditional tests to handle "divide-by-zero" scenarios. Finally, we introduced the concept of time within the context of expression design, and worked through examples of providing support for time-based analysis, such as the quantification of change over time in values, with MDX functions designed for that purpose.

Our next lesson, Using Named Sets, will begin an exploration of MDX Sets. We will discuss the differences between MDX expressions and MDX query statements, and practice working with rudimentary queries. We will explore set functions as part of our tutorial, as well as the general creation of sets and some of their potential uses.

» See All Articles by Columnist William E. Pearson, III



Go to page: Prev  1  2  3  4  5  6  7  

Tools:
Add databasejournal.com to your favorites
Add databasejournal.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed

MS SQL Archives








Latest Forum Threads
MS SQL Forum
Topic By Replies Updated
shrinking a Database tkatende 2 March 19th, 08:55 AM
Dropping database yogesphu 3 March 19th, 08:52 AM
Inner and outer select mussab 3 March 17th, 11:05 AM
Help with Getting Started jozepeter 1 March 15th, 11:03 AM









The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers