dbTalk Databases Forums  

In clause in mdx

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


Discuss In clause in mdx in the microsoft.public.sqlserver.olap forum.



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

Default In clause in mdx - 07-21-2005 , 02:08 AM






hi all

i have dimension which has 3 levels (prod, class, subclass) and the 2 levels
from the bottom are not unique. that means same subclass may include more
than on class and prod
my problem is that, i want to select a all prod which contans a particular
subclass

eg. i have a subclass named "S1" which is the chidren of more than on prods.
so i want to list all this prods which contain "S1" as its subclass.

how can i achieve this?

can anyone help me?

regards and thanx in advance

Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: In clause in mdx - 07-22-2005 , 09:54 PM






Here is a Foodmart Sales sample query, listing all Product Brands named
"Golden" with all their ancestors:

Quote:
Select
{[Measures].[Store Sales], [Measures].[Store Cost],
[Measures].[Profit]} on columns,
Hierarchize(Generate(Filter([Product].[Brand Name].Members,
[Product].CurrentMember.Name = "Golden"),
Ascendants([Product].CurrentMember))) on rows
from Sales
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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

Default Re: In clause in mdx - 07-25-2005 , 12:19 AM



hi thanks

it will dispaly all the records to me. but one more thing

here, the measures of the parent of 'Golden' should display only the summary
of 'Golden' and its parent should display only its summary regardless of all
members values. is it possible?

thanks

"Deepak Puri" wrote:

Quote:
Here is a Foodmart Sales sample query, listing all Product Brands named
"Golden" with all their ancestors:


Select
{[Measures].[Store Sales], [Measures].[Store Cost],
[Measures].[Profit]} on columns,
Hierarchize(Generate(Filter([Product].[Brand Name].Members,
[Product].CurrentMember.Name = "Golden"),
Ascendants([Product].CurrentMember))) on rows
from Sales



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
  #4  
Old   
Deepak Puri
 
Posts: n/a

Default Re: In clause in mdx - 07-25-2005 , 12:27 PM



You can try using VisualTotals():

Quote:
Select
{[Measures].[Store Sales], [Measures].[Store Cost],
[Measures].[Profit]} on columns,
VisualTotals(Hierarchize(Generate(Filter([Product].[Brand Name].Members,
[Product].CurrentMember.Name = "Golden"),
Ascendants([Product].CurrentMember))), "VisualTotal - *") on rows
from Sales
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
  #5  
Old   
shyju
 
Posts: n/a

Default Re: In clause in mdx - 07-25-2005 , 11:30 PM



thanks for the valuable information

i tried and found it working

but still i have one problem. that is, also i want to run this query in
Mondrian olap engine. but it doesn't have this function. i think it it not
possible in Mondrian. anyway thanks

thanks and regards - shyju

"Deepak Puri" wrote:

Quote:
You can try using VisualTotals():


Select
{[Measures].[Store Sales], [Measures].[Store Cost],
[Measures].[Profit]} on columns,
VisualTotals(Hierarchize(Generate(Filter([Product].[Brand Name].Members,
[Product].CurrentMember.Name = "Golden"),
Ascendants([Product].CurrentMember))), "VisualTotal - *") on rows
from Sales



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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.