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
  • Former Member
    Former Member $organization

    InfoMaker expression:  This may be correct.

     

    We were stumped with ticket masking syntax, and through trial-and-error this syntax worked for us:

    If(val in ('M','N','O','P','Q','R','S','T','U','V','W',X'),'',val)

     

    It sorta reminded me of an Excel If/Then/Else statement.

     

    David:

    You seem to be on the right track.  Hoping you find the correct solution.

     

     

     

    From: Tessitura Ticketing Forum [mailto:forums-ticketing@tessituranetwork.com] On Behalf Of Nick Reilingh
    Sent: Monday, October 20, 2014 15:31
    To: Wendell Baskin
    Subject: Re: [Tessitura Ticketing Forum] Using OR in Conditional Mask for Data Element

     

    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.

    From: David Pitak <bounce-davidpitak4103@tessituranetwork.com>
    Sent: 10/16/2014 4:49:26 PM

    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




    This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Ticketing Forum. You may reply to this message to post to the Ticketing forum or visit the site to search, read and post to the forums. In the interest of keeping the forum posts from becoming cluttered, we encourage you to delete previous message text from your reply before sending. Thank you!

Reply
  • Former Member
    Former Member $organization

    InfoMaker expression:  This may be correct.

     

    We were stumped with ticket masking syntax, and through trial-and-error this syntax worked for us:

    If(val in ('M','N','O','P','Q','R','S','T','U','V','W',X'),'',val)

     

    It sorta reminded me of an Excel If/Then/Else statement.

     

    David:

    You seem to be on the right track.  Hoping you find the correct solution.

     

     

     

    From: Tessitura Ticketing Forum [mailto:forums-ticketing@tessituranetwork.com] On Behalf Of Nick Reilingh
    Sent: Monday, October 20, 2014 15:31
    To: Wendell Baskin
    Subject: Re: [Tessitura Ticketing Forum] Using OR in Conditional Mask for Data Element

     

    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.

    From: David Pitak <bounce-davidpitak4103@tessituranetwork.com>
    Sent: 10/16/2014 4:49:26 PM

    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




    This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Ticketing Forum. You may reply to this message to post to the Ticketing forum or visit the site to search, read and post to the forums. In the interest of keeping the forum posts from becoming cluttered, we encourage you to delete previous message text from your reply before sending. Thank you!

Children
  • I think I just burned through 50 pages of ticket stock, but boy do I have some interesting news!

    I did some testing, and strangely enough, it appears as though logical statements using LIKE will not work unless the LIKE condition is parenthesized like I suggested.

    So:

    IF(val LIKE 'val1%' OR 1>0, 'true','false') --won't work, but

    IF((val LIKE 'val1%') OR 1>0, 'true','false') --will work just fine

    Go figure.

    Outside of that, I found the InfoMaker Expression reference, and it seems to match up. I've extracted the relevant pages out of the documentation and posted them in PDF format on my profile.

    Of particular interest, I think, is the "Matching text patterns" section and existence of the Match() function. You can use regular expressions in your ticket design masks! This allows you to take Wendell's "If val IN" example and simplify it to:

    If(Match(val, '^[M-X]$'), '', val) !!

    If your two conditional patterns are vastly different, then the LIKE statements with parens is probably the way to go, but RegEx opens up some VERY interesting possibilities. If you're interested in learning regular expressions, an invaluable tool is RegExr: http://www.regexr.com -- it runs your expressions interactively as you type and shows tooltips when you mouseover what you've written.



    [edited by: Nick Reilingh at 11:59 PM (GMT -6) on 20 Oct 2014] typos
  • Awesome!  I'll be sure to give it a try with the extra paren set.  This is a lot of very good info and should really open up what we can do with tickets.

     

    Thanks again!