Solved

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

Posted on 2006-07-09
2
493 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 500 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

717 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