DOWNLOAD THE CODE:
Download the Code 22394.zip

Listing 3 shows an example of slicing a cube by a member. This DDL statement creates a local cube with four dimensions: Time, Product, Customers, and Measure. The Measure dimension contains only Unit Sales. The Customers dimension includes only two levels (City and Name) and contains only Los Angeles and the customer names within Los Angeles. (Los Angeles is the member that I used to slice the cube.)

You need to remember a couple of details when you slice by a member. First, you can slice a cube by members only in the top dimension level in the local cube. For example, in Listing 3, I included the City and Name levels of the Customers dimension. Because City is the top level, City is the only level from which I can pick a member to slice. Second, remember that if you slice a dimension in a way that removes the dimension's default member, you need to specify a new default member. If you don't specify a new default member for the dimension, the top left member (i.e., the first sliced member) will be the default.

The ability to subset a cube by dimension or by slicing by a member is useful for limiting the amount of data that the local PC downloads. Subsetting a cube also reduces the complexity of analysis. Reducing the amount of displayed information to a minimum relevant subset is crucial because irrelevant information can keep users from seeing patterns or trends. Analyzing data is like looking for a needle in a haystack—the bigger the haystack, the longer it takes.

Listing 4 shows the complete Backus-Naur form (BNF) notation for the local-cube DDL statement that Listing 3 shows. BNF reveals the legal syntax rules for writing DDL statements. For those who aren't familiar with BNF notation, Table 1 shows definitions for the symbols in Listing 4. All other punctuation symbols (e.g., commas, parentheses) are literal—they're included in the described language just as you see them in the BNF notation.

A variation of the CREATE GLOBAL CUBE statement, CREATE SESSION CUBE, lets the MDX programmer use Analysis Services to create a cube local to the current session. CREATE SESSION CUBE is designed primarily for use with data-mining models. (For more information about why and how to use CREATE SESSION CUBE, see "Analysis Services Data Mining," September 2000.) You can also use CREATE SESSION CUBE to create session-level cubes that don't use data-mining models. You can use session-level cubes in an analytic application to limit access to portions of a cube, either to reduce complexity or to increase security. For an example of the legal syntax rules for CREATE SESSION CUBE statements, download the CREATE SESSION CUBE BNF notation from SQL Server Magazine's Web site at http://www.sqlmag.com (see "More on the Web" for download instructions).

Although Web applications are increasingly popular, more users are working on laptop computers. These trends conflict because laptops are frequently disconnected from the network and Web applications don't support disconnected users well. If you're building an analytic application for your company, don't forget your mobile users. The new local-cube DDL can make supporting mobile users easier. Be sure to give your users a mechanism to create local-cube files and the ability to take enough of the application with them to use those files.

To practice writing a query to analyze sales promotions, see the sidebar "November MDX Puzzle." For the answer to my last column's puzzle, see the sidebar "September MDX Puzzle Solution Revealed."

End of Article

Prev. page     1 [2]     next page -->



You must log on before posting a comment.

If you don't have a username & password, please register now.

Reader Comments

Your Comments (required):Very easy, clear, usefull; what I was looking for!

Roberto Calanca

 
 

ADS BY GOOGLE