Set, Tuple, and Member Specification

OLE DB Programmer's Reference

An axis contains a set of tuples. A tuple is a vector of members.

To specify the coordinates of an axis, follow these steps:

  1. Create an expression that generates members. Some expressions result in a single member, while others result in a set of members.
  2. Obtain the desired set of members for each dimension on the axis.
  3. Take a cross-product of these member sets to yield a set of tuples that represents an axis.

An application can use the simple expression syntax of OLE DB for OLAP to perform these operations. For the complete syntax of these expressions, see Chapter 26: MDX Grammar. Following are some examples of the many ways to choose a set of members:

  • Enumeration of members. The easiest way to specify a set of members is simply to list the desired members:
    {Venkatrao, Netz}
  • Set expressions. A set function generates a new set of members. For example, the function
    USA.CHILDREN

    generates the set

    {USA_North, USA_South}
  • A comma-separated list of set expressions also results in a set. For example, the expression
    {USA_North.CHILDREN, USA_South, Japan}

    results in the set

    {Seattle, Boston, USA_South, Japan}
  • Other ways of set specification make use of the natural order of members in a dimension. For example, the expression
    Netz:Pizzo

    on the SalesRep dimension, whose members are naturally ordered by last name, yields the set

    {Netz, Nakonieczny, Oks, Pace, Patel, Patterson, Pederson, Perin, Pizzo}
    Note   The expression is an inclusive range. That is, the members on both sides of the colon ( : ) specifier are included.

After an application generates sets that contain the members that it wants from each dimension on a given axis, it can use the CROSSJOIN function to get a cross-product of these sets.

Putting all these concepts together, a <set_expression> value for the x-axis in the example dataset is as follows:

CROSSJOIN({Venkatrao, Netz}, {USA_North.CHILDREN, USA_South, Japan})

The expression for the y-axis in the example dataset is the following:

{Qtr1.CHILDREN, Qtr2, Qtr3, Qtr4.CHILDREN}
Note   The MDX syntax is much more extensive than is shown in these few examples. Some functionality not covered here includes the following:
  • Set operations, such as UNION or INTERSECT
  • Functions to order sets, such as ORDER or HIERARCHIZE
  • Filter functions, such as TOPCOUNT, TOPPERCENT, BOTTOMCOUNT, BOTTOMPERCENT, or FILTER
  • Tree navigation functions, such as DESCENDANTS

    See "Advanced MDX" for more details about MDX. Chapter 26: MDX Grammar, contains the full MDX syntax.

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net