Free Newsletters:
DatabaseJournal  
DBANews
Search Database Journal:
 
HOME News MS SQL Oracle DB2 Access MySQL PostgreSQL PHP SQL Etc Scripts Links Discussion
internet.com

» HOME
» NEWS
» FEATURES
» SERIES
MS SQL
Oracle
MS Access
MySQL
DB2
» RESOURCES
Products
Scripts
Links
» DISCUSSION
» TECH JOBS

Marketplace Partners
Be a Marketplace Partner




internet.commerce
Be a Commerce Partner
Laptops
Baby Photo Contest
Promos and Premiums
Career Education
Find Software
Televisions
KVM Switches
Computer Hardware
Online Education
GPS Devices
Build a Server Rack
Condos For Sale
Domain registration
Rackmount LCD Monitor




MySpace Joins eBay, Yahoo in Open Profile Push

News Corp. Unit Under Fire for Ties to Hacker

Are Non-PC Devices Hurting 'Net Innovation?

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

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


Linked Data Planet Conference & Expo

CA ERwin® Data Modeler Proven database design and modeling. Efficiently analyze, design and deploy effective database solutions. Whitepaper: Manage SQL Server Deployments
Try it free: CA ERwin® Data Modeler


Guide to Oracle 11g and Database Migration
Oracle Database 11g includes more features for self-management and automation, which makes it easier for customers to cost-effectively manage their data. Download this Internet.com eBook for an overview of some of the new features in 11g and for an overview of the issues you need to consider as you prepare for a database migration. »
Innovate Faster with Oracle Database 11g
Read this in-depth analysis of 56 customers, which shows significant differences between the value software vendors Oracle and SAP deliver to midsize companies. »
Oracle Business Intelligence Standard Edition One
Find out how Newport Beach, CA-based Mobilitie is shaking up the telecom industry by leveraging technology to provide an entirely different financial model for deploying, upgrading, and owning wireless and wireline network assets. »
Business Intelligence and Enterprise Performance Management: Trends for Emerging Businesses
Quickly implementing an ERP software solution can be of tremendous benefit; however, companies often struggle to balance the benefits of reducing implementation time and cost with the risks of an accelerated deployment. Read this white paper to learn about easy-to-follow best practices for achieving a successful accelerated implementation. »
Making the Case for Oracle Database on Windows
Users benefit as vendors reduce enterprise complexity and deliver integration. »
Related Articles
Set Functions: The AddCalculatedMembers() Function
Set Functions: The .AllMembers Function
MDX in Analysis Services: Calculated Members: Introduction
MDX in Analysis Services: Calculated Members: Further Considerations and Perspectives

Production Manager (hands on)
Aquent
US-MA-Cambridge

Justtechjobs.com Post A Job | Post A Resume
MS SQL
April 7, 2008
Set Functions: The StripCalculatedMembers() Function
By William Pearson

About the Series ...

This article is a member of the series, MDX Essentials. The series is designed to provide hands-on application of the fundamentals of the Multidimensional Expressions (MDX) language, with each tutorial progressively adding features designed to meet specific real-world needs.

For more information about the series in general, as well as the software and systems requirements for getting the most out of the lessons included, please see my first article, MDX at First Glance: Introduction to MDX Essentials.

Note: Current updates are assumed for MSSQL Server, MSSQL Server Analysis Services, and the related Books Online and Samples.

Overview

In this lesson, we will introduce StripCalculatedMembers(), a basic set function which is often “just what the doctor ordered” in the context of the specific need. The general purpose of StripCalculatedMembers() is to retrieve the members of a specified set, after removing any calculated members.

StripCalculatedMembers() can be leveraged in a wide range of activities, from the support of simple list generation, to the support of sophisticated conditional and other calculations and presentations. We will introduce the function, commenting upon its operation and touching upon creative effects that we can employ it to deliver. As a part of our discussion, we will:

  • Examine the syntax surrounding the function;
  • Undertake illustrative examples of the uses of the function in practice exercises;
  • Briefly discuss the results datasets we obtain in the practice examples.

The StripCalculatedMembers() Function

Introduction

According to the Analysis Services Books Online, the StripCalculatedMembers() function “returns a set generated by removing calculated members from a specified set.” StripCalculatedMembers() has numerous applications. For example, the function can be leveraged within queries to create datasets, in reporting applications such as MSSQL Server Reporting Services, for the support of picklists within the reports, for the support of axes within various end presentations, and so forth. The StripCalculatedMembers() function provides an intuitive option anytime we need to present, in a returned dataset, all members –minus calculated members – that belong to a specified set.

As we have noted to have been the case with many individual MDX functions we have examined within this series, combining StripCalculatedMembers() with other functions allows us to further extend its power. We will get a taste of this synergy in the practice exercises that follow.

We will examine the syntax for the StripCalculatedMembers() function after a brief discussion in the next section. We will then explore, from the straightforward context of MDX queries, and within practice examples constructed to support hypothetical business needs, some of the capabilities it offers the knowledgeable user. This will allow us to activate what we explore in the Discussion and Syntax sections, and afford us some hands-on exposure in creating expressions that employ the StripCalculatedMembers() function.

Discussion

To restate our initial explanation of its operation, the StripCalculatedMembers() function examines a set expression that we specify and returns the members that remain after it removes all calculated members. StripCalculatedMembers() can be used for a great deal more than simple list retrieval, as we have intimated. When coupled with other functions or used within MDX scripts, among other applications, we can leverage StripCalculatedMembers() to support a wide range of analysis and reporting utility.

Let’s discuss syntax to further clarify the operation of StripCalculatedMembers().

Syntax

Syntactically, in using the StripCalculatedMembers() function to return a set of members (minus calculated members), the set expression upon which we seek to apply the function is specified within the parentheses to the right of the StripCalculatedMembers keyword. The function removes calculated members from the set expression (a valid MDX expression that returns a set) enclosed within the parentheses, and returns a set representing only the base members contained within the scope of the set expression. As we shall see, StripCalculatedMembers() removes all calculated members from a set, including those added within the query itself (via the WITH MEMBER keywords). StripCalculatedMembers() also removes all calculated members added to a specified set using either of the AddCalculatedMembers() or .AllMembers functions, both of which return calculated members defined on the Analysis Server.

NOTE: For more detail surrounding the AddCalculatedMembers() function, see Set Functions: The AddCalculatedMembers() Function, and for information about the .AllMembers function, see Set Functions: The .AllMembers Function. Both articles are members of my MDX Essentials series at Database Journal.

For a general introduction to calculated members, together with a discussion of further considerations and perspectives involved in working with calculated members, see Calculated Members: Introduction and Calculated Members: Further Considerations and Perspectives, respectively, both of which are members of my MDX in Analysis Services series at Database Journal.

The general syntax for the application of StripCalculatedMembers() appears in the following string:

  StripCalculatedMembers( <<Set_Expression>> )

Putting StripCalculatedMembers() to work is straightforward. When using the function to return the members, minus any calculated members, contained within a set expression, we simply supply the required set expression within the parentheses to the right of the StripCalculatedMembers keyword.

As an example, say we specify, within a query executed against the sample Adventure Works cube, a column axis containing all members of the Product Categories level of the Product dimension (specified as {[Product].[Product Categories].[Category].MEMBERS}), with a row axis such as the following:

  STRIPCALCULATEDMEMBERS( {[Measures].ALLMEMBERS} )

Moreover, say that we add a WHERE clause to filter the retrieved data set to Calendar Year 2004. Depending upon the calculated members we have defined within our cube (we might have added calculated members beyond those that appear in the pristine sample cube), we would expect to retrieve results similar to those depicted in Illustration 1.


Illustration 1: Example Returned Data: StripCalculatedMembers() Function Employed in Query

We can see, within the dataset returned above, that only base members / measures appear. (If we remove the StripCalculatedMembers() from around the rest of the row axis specification, we will see that a greater number of measures (both base and calculated) now appear, and that the column axis increases dramatically (from 30 measures, in my local cube, to 50-plus measures).

Because of the relative ease with which we can employ StripCalculatedMembers(), and because of the flexibility with which we can exploit it to meet various business needs (particularly those meeting metadata requirements), the function can become a popular member of our analysis and reporting toolsets. It is easy, for example, when considering the above scenario, to see that we might simply parameterize “on / off” behavior for the StripCalculatedMembers() function within a client application, such as Reporting Services, to allow information consumers to choose either “include” or “exclude” behavior with regard to calculated members within axes or picklists at report run time.

We will get some hands-on exposure to the StripCalculatedMembers() function in the section that follows.

Go to page: 1  2  3  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

Learn Tools & Techniques to Justify and Fund Your IT Investments. Download Complimentary Report Now!
Whitepaper: Enterprise Information Integration--Deployment Best Practices for Low-Cost Implementation
Data Sheet: IBM Information Server Blade
Download: SQL Backup & DBA Best Practices eBook
Five Trends for Application Development. Download Your Complimentary Report. Exclusive. Act Now.


Latest Forum Threads
MS SQL Forum
Topic By Replies Updated
How To Transfer Access Data Records To SQL ?? ankurdjariwala 1 May 8th, 12:24 PM
problem with federated server linking majidkhan 1 April 29th, 10:00 AM
"SELECT rowguidcol" from tables on linked servers? brentbordelon 1 April 25th, 04:12 PM
"SELECT rowguidcol" vs. "SELECT <actual name>" rgarrison 9 April 16th, 03:46 PM







JupiterOnlineMedia

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

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES