dbTalk Databases Forums  

MDX equivalent to SQL's IN operator

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


Discuss MDX equivalent to SQL's IN operator in the microsoft.public.sqlserver.olap forum.



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

Default MDX equivalent to SQL's IN operator - 12-02-2004 , 01:32 PM






Does MDX have an equivalent to sql's IN operator?
Here's my code:

MEMBER [d_MarketProvider].[M Total] AS
'Sum(
Filter(
[D_MarketProvider].[Market Name].Members,
[D_MarketProvider].CurrentMember.Properties("Market ID") = "1" or
[D_MarketProvider].CurrentMember.Properties("Market ID") = "6" or
[D_MarketProvider].CurrentMember.Properties("Market ID") = "8"
)
)'


This code works fine, but I was wondering if you could do something
like:

[D_MarketProvider].[Market Name].Members where
[D_MarketProvider].CurrentMember.Properties("Market ID") in
("1","6","8")

Any ideas?? Is this even posible?
Thanks in advance.

Francisco Alvarado

Reply With Quote
  #2  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: MDX equivalent to SQL's IN operator - 12-02-2004 , 07:04 PM






If the member property was mapped to a virual dimension, then you could just
slice on the member property values like any other dimension. That is the
whole purpose of a virtual dimension.
Hope that helps.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Francisco Alvarado" <franciscoalvarado (AT) gmail (DOT) com> wrote

Quote:
Does MDX have an equivalent to sql's IN operator?
Here's my code:

MEMBER [d_MarketProvider].[M Total] AS
'Sum(
Filter(
[D_MarketProvider].[Market Name].Members,
[D_MarketProvider].CurrentMember.Properties("Market ID") = "1" or
[D_MarketProvider].CurrentMember.Properties("Market ID") = "6" or
[D_MarketProvider].CurrentMember.Properties("Market ID") = "8"
)
)'


This code works fine, but I was wondering if you could do something
like:

[D_MarketProvider].[Market Name].Members where
[D_MarketProvider].CurrentMember.Properties("Market ID") in
("1","6","8")

Any ideas?? Is this even posible?
Thanks in advance.

Francisco Alvarado



Reply With Quote
  #3  
Old   
Wayne Snyder
 
Posts: n/a

Default Re: MDX equivalent to SQL's IN operator - 12-03-2004 , 07:00 AM



You could also create a named set which includes the values, then use the
named set in your MDX, but if this is a common TYPE of thing, virtual
dimension is the way to go.

--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)

I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org

"Francisco Alvarado" <franciscoalvarado (AT) gmail (DOT) com> wrote

Quote:
Does MDX have an equivalent to sql's IN operator?
Here's my code:

MEMBER [d_MarketProvider].[M Total] AS
'Sum(
Filter(
[D_MarketProvider].[Market Name].Members,
[D_MarketProvider].CurrentMember.Properties("Market ID") = "1" or
[D_MarketProvider].CurrentMember.Properties("Market ID") = "6" or
[D_MarketProvider].CurrentMember.Properties("Market ID") = "8"
)
)'


This code works fine, but I was wondering if you could do something
like:

[D_MarketProvider].[Market Name].Members where
[D_MarketProvider].CurrentMember.Properties("Market ID") in
("1","6","8")

Any ideas?? Is this even posible?
Thanks in advance.

Francisco Alvarado



Reply With Quote
  #4  
Old   
Michael Vardinghus
 
Posts: n/a

Default Re: MDX equivalent to SQL's IN operator - 12-04-2004 , 09:04 AM



Hi Dave

What would you chooe here

Have a dimension with a hierachy Level 1 - level 2 - level 3 - level 4 -
level 5

Now I need these hierachies:

a) Level 1, 2, 3, 4, 5
b) Level 5
c) Level 4
d) Level 2,3,4

Would you

1) make a) and b) physical and b)-c) virtual
2) make all physical (don't think so...)
3) make a) phyiscal and b)-d) virtual

/Michael V.

"Dave Wickert [MSFT]" <dwickert (AT) online (DOT) microsoft.com> wrote

Quote:
If the member property was mapped to a virual dimension, then you could
just
slice on the member property values like any other dimension. That is the
whole purpose of a virtual dimension.
Hope that helps.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no
rights.

"Francisco Alvarado" <franciscoalvarado (AT) gmail (DOT) com> wrote in message
news:15be89a1.0412021132.489b603b (AT) posting (DOT) google.com...
Does MDX have an equivalent to sql's IN operator?
Here's my code:

MEMBER [d_MarketProvider].[M Total] AS
'Sum(
Filter(
[D_MarketProvider].[Market Name].Members,
[D_MarketProvider].CurrentMember.Properties("Market ID") = "1" or
[D_MarketProvider].CurrentMember.Properties("Market ID") = "6" or
[D_MarketProvider].CurrentMember.Properties("Market ID") = "8"
)
)'


This code works fine, but I was wondering if you could do something
like:

[D_MarketProvider].[Market Name].Members where
[D_MarketProvider].CurrentMember.Properties("Market ID") in
("1","6","8")

Any ideas?? Is this even posible?
Thanks in advance.

Francisco Alvarado





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.