dbTalk Databases Forums  

Getting Dimension members based on other Dimension members

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


Discuss Getting Dimension members based on other Dimension members in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Vani Murarka
 
Posts: n/a

Default Getting Dimension members based on other Dimension members - 10-18-2004 , 07:24 AM






Hi Everyone,

I have a cube with revenue as the measure. CompanyId is one dimension
and CompanyType is another dimension.

It is possible to get a list of companies which belong to a particular
company type?

If I give the MDX query
select [Co].[Co Name].Members on columns from MainCube
where [CoType].[All CoType].[IT]

(IT being one of the Company Types) -

I get all companies, and not just the companies that are of IT type.

If I make company as a child level of the company type, then I can get
all children of [CoType].[All CoType].[IT], but I will need to get
companies by more than 1 independent criteria -
for example - list of all companies which are of "IT" type and are
located in the state GA and have number of employees > 1255.

Is there are way one can use cubes for this, or normal SQL and OLTP db
is the way to go?

I am totally new to OLAP and MDX - so any pointers will be really
appreciated.

Thanks and regards

Vani Murarka

Reply With Quote
  #2  
Old   
Brian Altmann
 
Posts: n/a

Default RE: Getting Dimension members based on other Dimension members - 10-18-2004 , 09:33 AM






By creating independent dimensions, in terms of cube metadata, there is no
relation between companies and types, that is to say, you know that such and
such company will only have data corresponding to a specific type, but
Analysis Services does not.
It would perfectly possible to have data for a given company distributed
among several members of the company type dimension.
You might evaluate using member properties (and eventually building virtual
dimensions from them).
If you did, you could use filter expressions, such as:

filter([Co Name].members,[Co Name].currentmember.properties("CoType")="Some
Type") on Rows

HTH,
Brian
www.geocities.com/brianaltmann/olap.html

"Vani Murarka" wrote:

Quote:
Hi Everyone,

I have a cube with revenue as the measure. CompanyId is one dimension
and CompanyType is another dimension.

It is possible to get a list of companies which belong to a particular
company type?

If I give the MDX query
select [Co].[Co Name].Members on columns from MainCube
where [CoType].[All CoType].[IT]

(IT being one of the Company Types) -

I get all companies, and not just the companies that are of IT type.

If I make company as a child level of the company type, then I can get
all children of [CoType].[All CoType].[IT], but I will need to get
companies by more than 1 independent criteria -
for example - list of all companies which are of "IT" type and are
located in the state GA and have number of employees > 1255.

Is there are way one can use cubes for this, or normal SQL and OLTP db
is the way to go?

I am totally new to OLAP and MDX - so any pointers will be really
appreciated.

Thanks and regards

Vani Murarka


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

Default Re: Getting Dimension members based on other Dimension members - 10-18-2004 , 09:37 AM



Vani,
it seems to me that you are dealing with a level of the same dimension:
dimension Company that has ID as the key and Type as an upper level...

"Vani Murarka" <vani.murarka (AT) gmail (DOT) com> ha scritto nel messaggio
news:966ff27a.0410180424.38125b71 (AT) posting (DOT) google.com...
Quote:
Hi Everyone,

I have a cube with revenue as the measure. CompanyId is one dimension
and CompanyType is another dimension.

It is possible to get a list of companies which belong to a particular
company type?

If I give the MDX query
select [Co].[Co Name].Members on columns from MainCube
where [CoType].[All CoType].[IT]

(IT being one of the Company Types) -

I get all companies, and not just the companies that are of IT type.

If I make company as a child level of the company type, then I can get
all children of [CoType].[All CoType].[IT], but I will need to get
companies by more than 1 independent criteria -
for example - list of all companies which are of "IT" type and are
located in the state GA and have number of employees > 1255.

Is there are way one can use cubes for this, or normal SQL and OLTP db
is the way to go?

I am totally new to OLAP and MDX - so any pointers will be really
appreciated.

Thanks and regards

Vani Murarka



Reply With Quote
  #4  
Old   
Matthias
 
Posts: n/a

Default Re: Getting Dimension members based on other Dimension members - 10-18-2004 , 09:38 AM



Hi Vani,

this filter on the companies should return the expected results:

with set [IT Companies] as
' Filter ([Co].[Co Name].Members, (Measures.Revenue, [CoType].[All
CoType].[IT]) > 0 )'
select { [IT Companies] } on columns from MainCube

cheers,
Matthias

"Vani Murarka" <vani.murarka (AT) gmail (DOT) com> schrieb im Newsbeitrag
news:966ff27a.0410180424.38125b71 (AT) posting (DOT) google.com...
Quote:
Hi Everyone,

I have a cube with revenue as the measure. CompanyId is one dimension
and CompanyType is another dimension.

It is possible to get a list of companies which belong to a particular
company type?

If I give the MDX query
select [Co].[Co Name].Members on columns from MainCube
where [CoType].[All CoType].[IT]

(IT being one of the Company Types) -

I get all companies, and not just the companies that are of IT type.

If I make company as a child level of the company type, then I can get
all children of [CoType].[All CoType].[IT], but I will need to get
companies by more than 1 independent criteria -
for example - list of all companies which are of "IT" type and are
located in the state GA and have number of employees > 1255.

Is there are way one can use cubes for this, or normal SQL and OLTP db
is the way to go?

I am totally new to OLAP and MDX - so any pointers will be really
appreciated.

Thanks and regards

Vani Murarka



Reply With Quote
  #5  
Old   
Isaac Corn
 
Posts: n/a

Default Re: Getting Dimension members based on other Dimension members - 10-19-2004 , 12:40 AM



I think Matthias is on the right tract with the filter, but I would use
the "isempy" for the condition rather than
" > 0", since in theory there could be a valid Company/Type combination
that happened to have has zero revenue.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

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.