dbTalk Databases Forums  

MDX to check if a particular string is a valid dimension member

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


Discuss MDX to check if a particular string is a valid dimension member in the microsoft.public.sqlserver.olap forum.



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

Default MDX to check if a particular string is a valid dimension member - 11-03-2004 , 02:43 PM






I am trying to find a function to check if a particular member exist in the
dimension. I will have a string that it could or not be a valid member in the
dimension. For

Example:
STRING ===> "[Time].[Standard].&[Jan 2002]"
I want to check if this string is a valid dimension member in my Time
dimension.

Any help would be appreciated. Thanks.

Reply With Quote
  #2  
Old   
Mark A Morris
 
Posts: n/a

Default RE: MDX to check if a particular string is a valid dimension member - 11-03-2004 , 04:59 PM







Dont think you can use the StringToMember.

Try
FILTER([Vintage].Standard.Members,
[Vintage].Standard.CurrentMember.UniqueName = "[Time].[Standard].&[Jan
2002]").Count=0
OR
FILTER([Vintage].Standard.Members,
[Vintage].Standard.CurrentMember.Properties("Key") = "Jan 2002").Count=0

"Sampa2870" wrote:

Quote:
I am trying to find a function to check if a particular member exist in the
dimension. I will have a string that it could or not be a valid member in the
dimension. For

Example:
STRING ===> "[Time].[Standard].&[Jan 2002]"
I want to check if this string is a valid dimension member in my Time
dimension.

Any help would be appreciated. Thanks.

Reply With Quote
  #3  
Old   
Chris Webb
 
Posts: n/a

Default RE: MDX to check if a particular string is a valid dimension member - 11-04-2004 , 05:24 AM



You can do this with the VBA ISERROR function, as in the following Foodmart
2000 example:

WITH MEMBER MEASURES.TEST AS 'IIF(VBA!ISERROR(STRTOVALUE("MEASURES.[UNIT
SALES]")), 1,0)'
MEMBER MEASURES.TEST2 AS 'IIF(VBA!ISERROR(STRTOVALUE("MEASURES.[THIS WONT
WORK]")), 1,0)'
SELECT {MEASURES.TEST, MEASURES.TEST2} ON 0 FROM SALES

HTH,

Chris


"Sampa2870" wrote:

Quote:
I am trying to find a function to check if a particular member exist in the
dimension. I will have a string that it could or not be a valid member in the
dimension. For

Example:
STRING ===> "[Time].[Standard].&[Jan 2002]"
I want to check if this string is a valid dimension member in my Time
dimension.

Any help would be appreciated. Thanks.

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.