dbTalk Databases Forums  

Excluding datamembers in MDX Query, but not in Dimension itself

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


Discuss Excluding datamembers in MDX Query, but not in Dimension itself in the microsoft.public.sqlserver.olap forum.



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

Default Excluding datamembers in MDX Query, but not in Dimension itself - 02-21-2006 , 06:40 AM






Hi,

I've got an Parent-Child-Dimension which allows nonleaf members to bear data
and to be visible. This works fine so far.

Now I'd like to query a cube, where this dimension is used in, in order to
get a dataset including ONLY the "nondatamembers". I need this dataset as a
source for a ReportingServices parameter, where the nonleaf members are
already shown and must not appear "twice".

Visually explained on the famous Continens/Countries/City-Dimension:
[All Continents]
+ [Europe]
+[(Europe data)]
+[France]
Quote:
[(France data)]
[Paris]
[Lyon]
+[Germany]
+[(Germany data)]
Quote:
[Berlin]
[Munich]
My MDX (which does still include the data members):
WITH
MEMBER [Measures].[StoreUniqueName] AS '[Stores].CurrentMember.UniqueName'
MEMBER [Measures].[StoreDisplayName] AS '[Stores].CurrentMember.Name'
SELECT {[Measures].[StoreUniqueName], [Measures].[StoreDisplayName]} ON
Columns,
{[Store].members} ON Rows
FROM [MyCube]

In pseudocode, i'm looking for
WITH
MEMBER [Measures].[StoreUniqueName] AS '[Stores].CurrentMember.UniqueName'
MEMBER [Measures].[StoreDisplayName] AS '[Stores].CurrentMember.Name'
SELECT {[Measures].[StoreUniqueName], [Measures].[StoreDisplayName]} ON
Columns,
{[Store]."NonDataMembers"} ON Rows
FROM [MyCube]


Thx for any hint!
Martin


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

Default Re: Excluding datamembers in MDX Query, but not in Dimension itself - 02-25-2006 , 01:18 AM






Below is a query that works with the Employees dimension in the FoodMart
2000 Database which does what you want. In fact I used your sample query
as a shell, so changing the cube and dimensions references is all you
will need to do in order to get it working.


WITH
MEMBER [Measures].[StoreUniqueName] AS
'[Employees].CurrentMember.UniqueName'
MEMBER [Measures].[StoreDisplayName] AS '[Employees].CurrentMember.Name'
SELECT {[Measures].[StoreUniqueName], [Measures].[StoreDisplayName]} ON
Columns,
FILTER({[Employees].members},NOT [Employees].CurrentMember IS
[Employees].CurrentMember.Parent.Datamember)
ON Rows
FROM [hr]


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

In article <029936CA-210E-43E5-B051-4264F6510FBD (AT) microsoft (DOT) com>,
Atrus2711 (AT) discussions (DOT) microsoft.com says...
Quote:
Hi,

I've got an Parent-Child-Dimension which allows nonleaf members to bear data
and to be visible. This works fine so far.

Now I'd like to query a cube, where this dimension is used in, in order to
get a dataset including ONLY the "nondatamembers". I need this dataset as a
source for a ReportingServices parameter, where the nonleaf members are
already shown and must not appear "twice".

Visually explained on the famous Continens/Countries/City-Dimension:
[All Continents]
+ [Europe]
+[(Europe data)]
+[France]
[(France data)]
[Paris]
[Lyon]
+[Germany]
+[(Germany data)]
[Berlin]
[Munich]

My MDX (which does still include the data members):
WITH
MEMBER [Measures].[StoreUniqueName] AS '[Stores].CurrentMember.UniqueName'
MEMBER [Measures].[StoreDisplayName] AS '[Stores].CurrentMember.Name'
SELECT {[Measures].[StoreUniqueName], [Measures].[StoreDisplayName]} ON
Columns,
{[Store].members} ON Rows
FROM [MyCube]

In pseudocode, i'm looking for
WITH
MEMBER [Measures].[StoreUniqueName] AS '[Stores].CurrentMember.UniqueName'
MEMBER [Measures].[StoreDisplayName] AS '[Stores].CurrentMember.Name'
SELECT {[Measures].[StoreUniqueName], [Measures].[StoreDisplayName]} ON
Columns,
{[Store]."NonDataMembers"} ON Rows
FROM [MyCube]


Thx for any hint!
Martin


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

Default Re: Excluding datamembers in MDX Query, but not in Dimension itsel - 03-06-2006 , 02:17 PM



Hi Darren,
sorry for answering so late....

Yes, your tips solved my problem.

Thanks!

Best regards,
Martin

"Darren Gosbell" wrote:

Quote:
Below is a query that works with the Employees dimension in the FoodMart
2000 Database which does what you want. In fact I used your sample query
as a shell, so changing the cube and dimensions references is all you
will need to do in order to get it working.


WITH
MEMBER [Measures].[StoreUniqueName] AS
'[Employees].CurrentMember.UniqueName'
MEMBER [Measures].[StoreDisplayName] AS '[Employees].CurrentMember.Name'
SELECT {[Measures].[StoreUniqueName], [Measures].[StoreDisplayName]} ON
Columns,
FILTER({[Employees].members},NOT [Employees].CurrentMember IS
[Employees].CurrentMember.Parent.Datamember)
ON Rows
FROM [hr]


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

In article <029936CA-210E-43E5-B051-4264F6510FBD (AT) microsoft (DOT) com>,
Atrus2711 (AT) discussions (DOT) microsoft.com says...
Hi,

I've got an Parent-Child-Dimension which allows nonleaf members to bear data
and to be visible. This works fine so far.

Now I'd like to query a cube, where this dimension is used in, in order to
get a dataset including ONLY the "nondatamembers". I need this dataset as a
source for a ReportingServices parameter, where the nonleaf members are
already shown and must not appear "twice".

Visually explained on the famous Continens/Countries/City-Dimension:
[All Continents]
+ [Europe]
+[(Europe data)]
+[France]
[(France data)]
[Paris]
[Lyon]
+[Germany]
+[(Germany data)]
[Berlin]
[Munich]

My MDX (which does still include the data members):
WITH
MEMBER [Measures].[StoreUniqueName] AS '[Stores].CurrentMember.UniqueName'
MEMBER [Measures].[StoreDisplayName] AS '[Stores].CurrentMember.Name'
SELECT {[Measures].[StoreUniqueName], [Measures].[StoreDisplayName]} ON
Columns,
{[Store].members} ON Rows
FROM [MyCube]

In pseudocode, i'm looking for
WITH
MEMBER [Measures].[StoreUniqueName] AS '[Stores].CurrentMember.UniqueName'
MEMBER [Measures].[StoreDisplayName] AS '[Stores].CurrentMember.Name'
SELECT {[Measures].[StoreUniqueName], [Measures].[StoreDisplayName]} ON
Columns,
{[Store]."NonDataMembers"} ON Rows
FROM [MyCube]


Thx for any hint!
Martin



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.