dbTalk Databases Forums  

MDX equivalent to SQL LIKE operator

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


Discuss MDX equivalent to SQL LIKE operator in the microsoft.public.sqlserver.olap forum.



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

Default MDX equivalent to SQL LIKE operator - 03-04-2004 , 04:01 AM






Hello
I want to use the FILTER keyword to extract all members from a dimension whose name is a given value. This is quite easy
FILTER( DimName.children, DimName.currentmember.properties("Name") = "MyValue"

What I now want to do is get every member whose name contains a given string. Something a bit like this
FILTER( DmName.children, DimName.currentmember.properties("Name") LIKE "%MyValue%"

That isn't valid MDX though. Does anyone know how to do this

cheer
Jamie Thomso


Reply With Quote
  #2  
Old   
Sanka
 
Posts: n/a

Default RE: MDX equivalent to SQL LIKE operator - 03-04-2004 , 06:31 AM






using the MDX filter () function and the vba text functions you have plenty of search possibilities.

filter (DimName.children, instr(DimName.currentmember.Properties("Name"),"My Value")>0)

HTH.
Cheers,
Sanka


----- Jamie Thomson wrote: -----

Hello,
I want to use the FILTER keyword to extract all members from a dimension whose name is a given value. This is quite easy:
FILTER( DimName.children, DimName.currentmember.properties("Name") = "MyValue" )

What I now want to do is get every member whose name contains a given string. Something a bit like this:
FILTER( DmName.children, DimName.currentmember.properties("Name") LIKE "%MyValue%")

That isn't valid MDX though. Does anyone know how to do this?

cheers
Jamie Thomson


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

Default RE: MDX equivalent to SQL LIKE operator - 03-04-2004 , 06:46 AM



Thanks Sanka, thats great
What do i need to do in order to be able to use VBA functions? Is it simply having MS Office installed on the same machine as the Pivot Table Service

Regard
Jami


----- Sanka wrote: ----

using the MDX filter () function and the vba text functions you have plenty of search possibilities

filter (DimName.children, instr(DimName.currentmember.Properties("Name"),"My Value")>0

HTH
Cheers
Sank


----- Jamie Thomson wrote: ----

Hello
I want to use the FILTER keyword to extract all members from a dimension whose name is a given value. This is quite easy
FILTER( DimName.children, DimName.currentmember.properties("Name") = "MyValue"

What I now want to do is get every member whose name contains a given string. Something a bit like this
FILTER( DmName.children, DimName.currentmember.properties("Name") LIKE "%MyValue%"

That isn't valid MDX though. Does anyone know how to do this

cheer
Jamie Thomso


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

Default RE: MDX equivalent to SQL LIKE operator - 03-04-2004 , 07:41 AM



Yes. VBA is a core component of Microsoft Office

Cheers
Sank

----- Jamie wrote: ----

Thanks Sanka, thats great
What do i need to do in order to be able to use VBA functions? Is it simply having MS Office installed on the same machine as the Pivot Table Service

Regard
Jami


----- Sanka wrote: ----

using the MDX filter () function and the vba text functions you have plenty of search possibilities

filter (DimName.children, instr(DimName.currentmember.Properties("Name"),"My Value")>0

HTH
Cheers
Sank


----- Jamie Thomson wrote: ----

Hello
I want to use the FILTER keyword to extract all members from a dimension whose name is a given value. This is quite easy
FILTER( DimName.children, DimName.currentmember.properties("Name") = "MyValue"

What I now want to do is get every member whose name contains a given string. Something a bit like this
FILTER( DmName.children, DimName.currentmember.properties("Name") LIKE "%MyValue%"

That isn't valid MDX though. Does anyone know how to do this

cheer
Jamie Thomso


Reply With Quote
  #5  
Old   
Richard Tkachuk [MS]
 
Posts: n/a

Default Re: MDX equivalent to SQL LIKE operator - 03-04-2004 , 02:06 PM



Nothing other than the client install is required.

Cheers,
Richard

--
This posting is provided 'AS IS' with no warranties, and confers no rights.

"Jamie" <jamiekthomson (AT) removeme (DOT) blueyonder.co.uk> wrote

Quote:
Thanks Sanka, thats great.
What do i need to do in order to be able to use VBA functions? Is it
simply having MS Office installed on the same machine as the Pivot Table
Service?
Quote:
Regards
Jamie


----- Sanka wrote: -----

using the MDX filter () function and the vba text functions you have
plenty of search possibilities.

filter (DimName.children,
instr(DimName.currentmember.Properties("Name"),"My Value")>0)

HTH.
Cheers,
Sanka


----- Jamie Thomson wrote: -----

Hello,
I want to use the FILTER keyword to extract all members from a
dimension whose name is a given value. This is quite easy:
FILTER( DimName.children,
DimName.currentmember.properties("Name") = "MyValue" )

What I now want to do is get every member whose name contains a
given string. Something a bit like this:
FILTER( DmName.children,
DimName.currentmember.properties("Name") LIKE "%MyValue%")

That isn't valid MDX though. Does anyone know how to do this?

cheers
Jamie Thomson




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.