dbTalk Databases Forums  

mdx query to retrieve a member's dimensions

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


Discuss mdx query to retrieve a member's dimensions in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Tai
 
Posts: n/a

Default mdx query to retrieve a member's dimensions - 07-26-2004 , 10:42 AM






does anyone know if the following is possible ?

I am trying to retrieve the sales for every product and sales of the
product family that each product belongs to,
I tried the mdx query below, but I get back "unknown dimension:
[Product].[Product Family]",

with member [measures].[Product Family Sales] as
'([Product].[Product Family].CurrentMember,[Measures].[Unit Sales])'
select
{[Measures].[Unit Sales],[Measures].[Product Family Sales]} ON
COLUMNS,
{[Product].Members}
ON ROWS FROM
[Sales]

Reply With Quote
  #2  
Old   
Olivier Matrat
 
Posts: n/a

Default Re: mdx query to retrieve a member's dimensions - 07-26-2004 , 11:13 AM






Greetings

Try the Ancestor() function, as follows:

with
member [measures].[Product Family Sales] as
'(Ancestor([Product].CurrentMember,[Product].[Product
Family]),[Measures].[Unit Sales])'
select
{[Measures].[Unit Sales],[Measures].[Product Family Sales]} ON COLUMNS,
{[Product].Members} ON ROWS
FROM [Sales]

HTH

Olivier.


"John Tai" <devtai (AT) yahoo (DOT) com> wrote

Quote:
does anyone know if the following is possible ?

I am trying to retrieve the sales for every product and sales of the
product family that each product belongs to,
I tried the mdx query below, but I get back "unknown dimension:
[Product].[Product Family]",

with member [measures].[Product Family Sales] as
'([Product].[Product Family].CurrentMember,[Measures].[Unit Sales])'
select
{[Measures].[Unit Sales],[Measures].[Product Family Sales]} ON
COLUMNS,
{[Product].Members}
ON ROWS FROM
[Sales]



Reply With Quote
  #3  
Old   
John Tai
 
Posts: n/a

Default Re: mdx query to retrieve a member's dimensions - 07-27-2004 , 11:11 AM



that's very good, thanks

but instead of the same dimension (Product dimension),
what if I want to see a measure from a different dimension,
for example,
i would like to retrieve the employee salary for every employee
(employee dimension),
and the total employee salary for the store (store dimension) that
each employee belongs to,


with member [measures].[Store Salary] as
'([Store].[All Stores].CurrentMember,[Measures].[Employee Salary])'
select
{[Measures].[Employee Salary],[Measures].[Store Salary]} ON
COLUMNS,
{[Employees].Members}
ON ROWS FROM
[HR]

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.