christopher sawtelle 2 Posted July 1, 2015 Share Posted July 1, 2015 Is there an "includes" or "contains" function for an IF statement in a custom expression I know we have on ina CASE statement but wondering about the IF. Can't seem to get one to work. Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted July 2, 2015 Share Posted July 2, 2015 You can sort it out by lowercase the [column]. Link to comment Share on other sites More sharing options...
David Courtin Posted October 23, 2015 Share Posted October 23, 2015 Hi Chris, you can use ~=, on the expression, here is the help content Can be part of an 'If' or 'Case' statement. Returns true if the Arg2 regular expression string matches the Arg1 string. Examples: If( "aab" ~= "a+" , "true", "false" ) Case when "aba" ~= ".a+$" then "true" else "false" end OR the Find function, should the value is a Text, the result is 0 or null if their is no matching or the index of the first occurence. Link to comment Share on other sites More sharing options...
christopher sawtelle 2 Posted October 23, 2015 Author Share Posted October 23, 2015 Yea, this seems to work to a point but how could I do a compound statement such as if([column] ~= "apple" or "pear",1,0) it works fine for apple and find all variations but I may have multiple words to look for in a description. Link to comment Share on other sites More sharing options...
christopher sawtelle 2 Posted October 23, 2015 Author Share Posted October 23, 2015 Ok just figured it out. if([column] ~= "apple" or [column] ~= "pear",1,0) This will work nicely I think. Link to comment Share on other sites More sharing options...
christopher sawtelle 2 Posted October 23, 2015 Author Share Posted October 23, 2015 Found out one more piece of useful information. This is case sensitive so "Apple" is different than "apple". May be obvious to some but I didn't think of it at first. Link to comment Share on other sites More sharing options...
Shaun Simon Posted October 23, 2015 Share Posted October 23, 2015 Chris I noticed the case sensitivity so I generally compare string values as Trim(Upper([stringColumn])) ~= "this+" so that case and white spaces doesn't become a factor. Link to comment Share on other sites More sharing options...
Donald Johnson Posted August 29, 2020 Share Posted August 29, 2020 thne its: if([column] ~= "[aA]pple" or [column] ~= "[pP]ear",1,0) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now