Solved

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

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

763 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