dbTalk Databases Forums  

List members from different levels filtered by a condition and a property

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


Discuss List members from different levels filtered by a condition and a property in the microsoft.public.sqlserver.olap forum.



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

Default List members from different levels filtered by a condition and a property - 11-02-2005 , 01:04 PM






Hi,
I am from Argentina and i'm working in 'Telecom Argentina', forgive
me for my english, but i'll try to explain my self as best as posible.
I have just started working in a project with MDX and i've been trying
for a while to accomplish an specific result without any success.

What i have is this (i will use letters, instead of the real name of
the cubes and dimensions because they are all in spanish):

cube: 'CUBE' - Dimension: 'A'(it's a parent-child, and the depth is
unknown)

How can i list all members, no matter in what level they are, that meet
a condition ([Measures].[X]>10) and that have and specific value in a
property (A.CurrentMember.Properties("P")="<value>")?


Reply With Quote
  #2  
Old   
Dean Adam
 
Posts: n/a

Default RE: List members from different levels filtered by a condition and a p - 11-02-2005 , 02:32 PM






Here's an expression using the FILTER function to return a set: -

filter(
A.AllMembers,
A.CurrentMember.Properties("P")="<value>" AND
[Measures].[X] > 10
)

A good way to test something like this is to create a calculated member in
the measures to display the result as a string, like this: -

SetToStr
filter(
A.AllMembers,
A.CurrentMember.Properties("P")="<value>" AND
[Measures].[X] > 10
)
)

--
Dean Adam
Magenic Technologies


"ellerado (AT) gmail (DOT) com" wrote:

Quote:
Hi,
I am from Argentina and i'm working in 'Telecom Argentina', forgive
me for my english, but i'll try to explain my self as best as posible.
I have just started working in a project with MDX and i've been trying
for a while to accomplish an specific result without any success.

What i have is this (i will use letters, instead of the real name of
the cubes and dimensions because they are all in spanish):

cube: 'CUBE' - Dimension: 'A'(it's a parent-child, and the depth is
unknown)

How can i list all members, no matter in what level they are, that meet
a condition ([Measures].[X]>10) and that have and specific value in a
property (A.CurrentMember.Properties("P")="<value>")?



Reply With Quote
  #3  
Old   
ellerado@gmail.com
 
Posts: n/a

Default Re: List members from different levels filtered by a condition and a p - 11-02-2005 , 03:24 PM



Thanks for responding so soon, I really appreciate your help.

But if i may, i would like to ask one more thing.
What if i wanted to know not all members of the HOLE dimension, but
only those starting from an arbitrary/random member of the dimension.
Instead of "[Red].AllMembers", let's say
"[Red].[<level-1>].[<level-2>]...[<level-n>].AllMembers".


This is what my query looks like so far.

SELECT
{[Measures].AllMembers} ON COLUMNS,
{ filter( [Red].AllMembers,
[Red].CurrentMember.Properties("Categoria")="CENTRAL" AND
[Measures].[VAP] < 10 ) } ON ROWS
FROM IP
WHERE [DimFecha].[2005].[2]

I tried this, but it didn't work:

SELECT
{[Measures].AllMembers} ON COLUMNS,
{ filter( [Red].[Telecom].[Nivel1 - 00].AllMembers,
[Red].CurrentMember.Properties("Categoria")="CENTRAL" AND
[Measures].[VAP] < 10 ) } ON ROWS
FROM IP
WHERE [DimFecha].[2005].[2]

I suspect that it didn't work because "AllMember" can be used only with
dimensions.

Thanks for help.
Emiliano


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

Default Re: List members from different levels filtered by a condition and a p - 11-02-2005 , 09:42 PM



Use the Descendants() function to get a list of members below a given
member. Descendants has a couple of other parameters that come in handy,
but the default will give you everything below the specified member.

eg.
Quote:
SELECT
{[Measures].AllMembers} ON COLUMNS,
{ filter( Descendants([Red].[Telecom].[Nivel1 - 00]),
[Red].CurrentMember.Properties("Categoria")="CENTRAL" AND
[Measures].[VAP] < 10 ) } ON ROWS
FROM IP
WHERE [DimFecha].[2005].[2]
Quote:
--
Regards
Darren Gosbell [MCSD]
<dgosbell_at_yahoo_dot_com>
Blog: http://www.geekswithblogs.net/darrengosbell

In article <1130966647.282857.243180 (AT) g47g2000cwa (DOT) googlegroups.com>,
ellerado (AT) gmail (DOT) com says...
Quote:
Thanks for responding so soon, I really appreciate your help.

But if i may, i would like to ask one more thing.
What if i wanted to know not all members of the HOLE dimension, but
only those starting from an arbitrary/random member of the dimension.
Instead of "[Red].AllMembers", let's say
"[Red].[<level-1>].[<level-2>]...[<level-n>].AllMembers".


This is what my query looks like so far.

SELECT
{[Measures].AllMembers} ON COLUMNS,
{ filter( [Red].AllMembers,
[Red].CurrentMember.Properties("Categoria")="CENTRAL" AND
[Measures].[VAP] < 10 ) } ON ROWS
FROM IP
WHERE [DimFecha].[2005].[2]

I tried this, but it didn't work:

SELECT
{[Measures].AllMembers} ON COLUMNS,
{ filter( [Red].[Telecom].[Nivel1 - 00].AllMembers,
[Red].CurrentMember.Properties("Categoria")="CENTRAL" AND
[Measures].[VAP] < 10 ) } ON ROWS
FROM IP
WHERE [DimFecha].[2005].[2]

I suspect that it didn't work because "AllMember" can be used only with
dimensions.

Thanks for help.
Emiliano




Reply With Quote
  #5  
Old   
ellerado@gmail.com
 
Posts: n/a

Default Re: List members from different levels filtered by a condition and a p - 11-03-2005 , 09:56 AM



Thanks Darrel/Adam, this last answer gave me the result i was looking
for.
Thanks to all, this group really proved its purpose and that is formed
by a fine group of people.

Emiliano D. Llera Do Campo
Telecom Argentina S.A.


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.