Databases Reference
In-Depth Information
This query actually results in a list of all the quarters displayed in the results.
The reason is because [Date].[Calendar].[Calendar Quarter].[Q1 CY 2004].LEVEL
evaluates to [Date].[Calendar Year].[Calendar Semster].[Calender Quarter]. From
this, you get the list of all quarters for the relevant calendar year.
String Manipulation Functions
To extract the names of sets, tuples, and members in the form of a
string, you can use functions like MemberToStr ( <Member_Expression>
) and to do the inverse, take a string and create a member expression,
you can use StrToMember (<String> ). Consider the following case, in
which there is a client application that displays sales information for all
countries. When a user selects a specific country, you need to extract
the sales information for the specific country from Analysis Services. Be-
cause the countries are represented as strings in the client application,
you need to translate this string to a corresponding member, and then
you can retrieve the data. String manipulation functions are useful while
accepting parameters from users and transforming them to correspond-
ing MDX objects. However there is a significant performance cost in-
volved while using string manipulation functions. Hence we recommend
you try to use these functions only if necessary.
SELECT STRTOMEMBER ('[Customer].[Country].[Australia]')
ON COLUMNS
FROM [Adventure Works]
Other Functions
Four other function categories exist: Subcube and Array both have one function
each. The final two categories are logical functions, which allow you to do Boolean
evaluations on multidimensional objects, and tuple functions that you can use to
access tuples. In addition to that, Analysis Services 2005 has introduced several
new MDX functions. You have seen some of them in this chapter such as
Nonempty and Exists. You will learn more about these in Chapter 7 and Appendix
A .
Search WWH ::




Custom Search