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

» Database Journal Home
» Database News
» 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


















A Year For Smarter Phones, Crowded Clouds

Hardware Vendors Face a Storm of Uncertainty

China Blocking NYTimes.com Access

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

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


Database Journal | DBA Support | SQLCourse | SQLCourse2 | Swynk







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

Application Support Professional
The Computer Merchant, Ltd
US-RI-Warwick

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

In our expression, the .PrevMember function refers to the current member as a "starting point," and returns the immediately preceding member occupying the same level in the Time hierarchy. This is especially useful within the context of "year-end cutoffs," and other financial and accounting time range "boundaries;" the function is quite effective as it ignores such boundaries and returns the immediately preceding member, as is desired in most cases.

17.  Append the following to the expression in the Value Expression box

, [Amount]

18.  Enclose the entire expression in parentheses.

The final expression appears in Illustration 19 below:


Illustration 19: The Expression as it Appears in the Value Expression Box

19.  Click OK to accept the expression as displayed.

The results dataset appears in the Data Viewing pane as depicted in Illustration 20.


Illustration 20: The Results in the Data Viewing Pane

We can readily see that the values that appear in the Prior Amount column accurately reflect the prior period balance, as shown in the associated previous time period slot in the Amount column. For example, the Q4, Month 11 Prior Amount ($ 28,448.04) matches the Q4, Month 10 Amount. The same applies to the Quarter level rollups (except for periods for which the cube does not contain data for a prior period / a respective time member).

Now let's repeat the process for the Average Total Cost Per Unit calculated member.

1.      Select Insert --> Calculated Member

The Calculated Member Builder appears.

2.      Type Prior Avg into the Member Name box.

3.      In the Functions tree, expand the Member folder, as we did earlier.

4.      Double-click the PrevMember function within the Member folder.

5.      Single-click the <<Member>> token, within the Value Expression box, to select it.

6.      Double-click the CurrentMember function within the Member folder.

7.      In the Value Expression box, single-click the newly appearing <<Dimension>> token to select it.

8.      Double-click the Time dimension within the Data tree.

The Value Expression box of the Calculated Member Builder now appears as shown in Illustration 21.


Illustration 21: The Expression Takes Form

9.      Append the following to the expression in the Value Expression box

, [Avg Total Cost Per Unit]

10.  Enclose the entire expression in parentheses.

The final expression appears in Illustration 22 below:


Illustration 22: The Expression as it Appears in the Value Expression Box

11.  Click OK to accept the expression as displayed.

Let's free up some real estate on the screen.

12.  Click the Units Sold calculated member in the cube tree to select it.

13.  In the Properties pane, select the Advanced tab.

14.  Click the Visible property.

15.  Select False in the selector box for the Visible property.

The Properties pane - Advanced tab appears as depicted in Illustration 23.


Illustration 23: The Expression as it Appears in the Value Expression Box

16.  Press Enter to apply the modification.

The new results dataset appears in the Data Viewing pane, as depicted in Illustration 24.


Illustration 24: The Results in the Data Viewing Pane

As we noted in our earlier example, we can see that the values that appear in the Prior Avg column accurately reflect the prior period balance, as shown in the associated previous time period slot in the Avg Total Cost Per Unit column. For example, the Q4 Total Prior Avg ($ 1.50) matches the Q3 Total Avg Cost Per Unit value. The same applies to the Year level rollups (both the 1997 Total Avg Cost Per Unit and 1998 Total Prior Avg rows reflect $ 1.49).

MDX handles "parallel period" time considerations in much the same fundamental way: through the comprehension of hierarchical relationships, which was built into its design. Let's take a look at how we can leverage this functionality yet further in the final section of this lesson.

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

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
save execution plan jimguy999 2 December 22nd, 07:53 AM
Copy Record and duplicate to a new table 02119 0 December 22nd, 06:15 AM
merging 2 rows into 1 row taffer 0 December 17th, 12:28 PM
Linked Server 2005 error connecting to Unidata anam 10 December 11th, 09:29 AM








internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers