Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi guys,
how can i find if a value exists within a field or variable.
for example a variable is made of concat(field,;) and has Red; yellow;Green.
I want a text box with if statement to show 1 if the yellow exist within the variable and 0 if not..
if ( index ( [YourField] , 'yellow' ) > 0 , 1 , 0 )
Use Index or SubStringCount
index(s1 , s2[ , n])
Position of a substring. This function gives the starting position of the n:th occurrence of substring s2 in string s1. If n is omitted, the first occurrence is assumed. If n is negative, the search is made starting from the end of string s1. The result is an integer. The positions in the string are numbered from 1 and up.
substringcount( text , substring)
Returns the number of times the string substring appears within the string text. The result is an integer. If there is no match, 0 is returned
if ( index ( [YourField] , 'yellow' ) > 0 , 1 , 0 )
try like this
if(match(variablename,'yellow'),1,0)
or
if($(variablrname)=yellow),1,0)
Thank you!