Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to get in MDX the lowest level source of a dimension?

Posted on 2006-07-09
2
Medium Priority
?
512 Views
Last Modified: 2008-02-01
Dear experts,
I need to get the lowest level in a dimension, for example level "Store Name" in dimension STORE:

     Level             Source Column             Source Table             Member Count
     Store Country             store_country             store             3
     Store State             store_state             store             10
     Store City             store_city             store             24
     Store Name             store_id             store             24

(this is Sales cube in FoodMart Olap database example)

I need to know his Source Column and Source Table. (store_id and store respectivly).

More generally, how do you get metadata from MDX?

Thanks in advance
0
Comment
Question by:icad01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
raj_ earned 2000 total points
ID: 17067578
please investigate this thread:
http://groups.google.com/group/microsoft.public.sqlserver.datawarehouse/browse_frm/thread/cf29f044418bf3a9/9d78aaee689fe1fe?tvc=1&q=information+schema+in+MDX&hl=en#9d78aaee689fe1fe


MDX always works with the cubes, so it is not possible to obtain list of the
cubes through MDX.
If you already know the cube, you can get some information about dimensions
and levels, i.e.

WITH MEMBER Measures.X AS Dimensions.Count
SELECT {X} ON 0 FROM Sales


Will give you count of dimensions. After that you can do something like


WITH MEMBER Measures.X AS Dimensions(0).Name
SELECT {X} ON 0 FROM Sales


to get the name of the dimension, and


WITH MEMBER Measures.X AS Dimensions(0).Levels.Count
SELECT {X} ON 0 FROM Sales


0
 

Author Comment

by:icad01
ID: 17068528
Dear raj,
thanks for your fast answer.
I realize that I have a lot to learn before using MDX.
I didn't know where to put the code to get any result (in ADO?)!
Thanks anyway.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question