Using OR in Conditional Mask for Data Element

Hey all,

 

I've been trying to use this without any success.  Basically I'd like any element to show if peformance code(or description) contains certain strings, and to be blank ('') otherwise.

 

I've tried if(val like 'string1%' or val like 'string2%', 'Output', '')  

 

Is there a syntax that will make this work?

 

Thanks,

David

Parents
  • I believe what you're actually writing in the mask field is an InfoMaker expression. Someone can correct me on this, but perhaps the place to look for the valid operators and functions would be the IM documentation? Or maybe PowerBuilder docs, or something from Sybase?

    My guess is if there's no boolean "text contains" operator or function, to do this you'll need to use something like a "string index". If there's a strindex() function (and I have no idea if there is), something like IF(strindex('string1', val)>0, 'output', '') would be what you're looking for.

    I've been interested in a comprehensive language spec for the mask field for months, so I'll look into this later and report back if I find anything useful.

  • Thanks for the insight all!

    I used "like" with a single string sucessfully, just not with a series of values.  

    If we could find out the syntax/language used in the masks, it would go a long way towards making the most of it.

    Thanks again!

  • Oh! I missed that part about what you're doing; got excited about looking for syntax.

    Have you tried adding parentheses? If((val LIKE 'string%') OR (val LIKE 'string2%), 'output', '') ?

Reply Children
No Data