dbTalk Databases Forums  

MDX to read a dimension

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss MDX to read a dimension in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
karenmiddleol@yahoo.com
 
Posts: n/a

Default MDX to read a dimension - 10-04-2005 , 06:59 AM






I want to populate a drop down box with the values in the analysis
services Dimension.

Is there a way of querying a AS 2000 dimension with MDX the way we
query cubes.

Please help how I can query the Product dimension from the Foodmart
database.

Also, similarly can we query the AS 2000 hierarchy.


Thanks
Karen


Reply With Quote
  #2  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: MDX to read a dimension - 10-04-2005 , 01:25 PM






Look in BOL for schema rowsets. There are several implemented for Analysis
Services which allow you to browse the cube and dimension metadata.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI Systems Team
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.


<karenmiddleol (AT) yahoo (DOT) com> wrote

Quote:
I want to populate a drop down box with the values in the analysis
services Dimension.

Is there a way of querying a AS 2000 dimension with MDX the way we
query cubes.

Please help how I can query the Product dimension from the Foodmart
database.

Also, similarly can we query the AS 2000 hierarchy.


Thanks
Karen




Reply With Quote
  #3  
Old   
Tomas
 
Posts: n/a

Default RE: MDX to read a dimension - 10-04-2005 , 05:06 PM



Here is a sample code.
I have dimension call Calendar(It is really a time dimension with Days,
Month , years , you get the idea) and I want to create a drop down to allow
my user to select a Month, Quarter or year, so that I can query using MDX
code.
Here is the sample code. Let me know if you have any problem


with Member [Measures].[TimeMemberUniqueName] as
'[Calendar].CurrentMember.UniqueName'

member [Measures].[TimeDisplayName] as
'Space([calendar].CurrentMember.Level.Ordinal * 4) +
Calendar.CurrentMember.Name'

select
{[Measures].[TimeMemberUniqueName],[Measures].[TimeDisplayName]} on Columns,
{[calendar].members} on rows
from [Cube that uses my Calendar dimension]

Tomas

"karenmiddleol (AT) yahoo (DOT) com" wrote:

Quote:
I want to populate a drop down box with the values in the analysis
services Dimension.

Is there a way of querying a AS 2000 dimension with MDX the way we
query cubes.

Please help how I can query the Product dimension from the Foodmart
database.

Also, similarly can we query the AS 2000 hierarchy.


Thanks
Karen



Reply With Quote
  #4  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: MDX to read a dimension - 10-04-2005 , 08:12 PM



Quote:
Look in BOL for schema rowsets. There are several implemented for Analysis
Services which allow you to browse the cube and dimension metadata.

If you are using ADOMD/ADOMD.NET, the stick with the schema rowsets as
suggested by Dave. However, if you are trying to get a list of member
for use by Reporting Services for example I don't think you can get to
the schema rowsets (although I would be happy to be corrected...Dave?)

For Reporting Services I have used MDX similar to the following:

WITH
Member Measures.ProductName as 'VBA!String
(Product.CurrentMember.Level.Ordinal," ") + Product.CurrentMember.Name'
Member Measures.ProductUniqueName as
'Product.CurrentMember.UniqueName'
SELECT
PRODUCT.MEMBERS ON ROWS,
{Measures.Fake
,Measures.ProductName
,Measures.ProductUniqueName} ON COLUMNS
FROM Sales

The 'ProductName' measure gives you an indented version of the product
dimension, 'ProductUniqueName' gives you the uniquename that you can
incorporate back into your MDX query.

I think both techniques will work fine with hierarchies, in AS2k
hierarchies behave much like just another dimension with a specific
naming convention.

--
Regards
Darren Gosbell [MCSD]
<dgosbell_at_yahoo_dot_com>
Blog: http://www.geekswithblogs.net/darrengosbell


Reply With Quote
  #5  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: MDX to read a dimension - 10-05-2005 , 04:51 PM



If you are going to get metadata within your cube, then I would stick to the
standard mechanisms, i.e. schema rowsets. If this is just a one-off that you
have a point requirement for then either Darren's or Tomas' solution are
great.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI Systems Team
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Darren Gosbell" <xxx (AT) xxx (DOT) com> wrote

Quote:
Look in BOL for schema rowsets. There are several implemented for
Analysis
Services which allow you to browse the cube and dimension metadata.


If you are using ADOMD/ADOMD.NET, the stick with the schema rowsets as
suggested by Dave. However, if you are trying to get a list of member
for use by Reporting Services for example I don't think you can get to
the schema rowsets (although I would be happy to be corrected...Dave?)

For Reporting Services I have used MDX similar to the following:

WITH
Member Measures.ProductName as 'VBA!String
(Product.CurrentMember.Level.Ordinal," ") + Product.CurrentMember.Name'
Member Measures.ProductUniqueName as
'Product.CurrentMember.UniqueName'
SELECT
PRODUCT.MEMBERS ON ROWS,
{Measures.Fake
,Measures.ProductName
,Measures.ProductUniqueName} ON COLUMNS
FROM Sales

The 'ProductName' measure gives you an indented version of the product
dimension, 'ProductUniqueName' gives you the uniquename that you can
incorporate back into your MDX query.

I think both techniques will work fine with hierarchies, in AS2k
hierarchies behave much like just another dimension with a specific
naming convention.

--
Regards
Darren Gosbell [MCSD]
dgosbell_at_yahoo_dot_com
Blog: http://www.geekswithblogs.net/darrengosbell



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.