Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
i am looking for help for a simple wildcard issue I am over looking. I have a data table where I am trying to change the background color when a certain name string is returned. I can't seem to figure out the correct syntax. Here is my example:
names:
John
John Smith
John Adams
syntax:
if([field]='john*', blue())
Looking for help on step I am missing to correct.
Thank you in advance.
The reason in this case can be as Enrique points out, but it can also be that [field] does not equal a distinct value. A reference to a field will be calculated in the same way as a Only() call. In this case try running Only([field]) to see that it actually returns a comparable value.
I would like to suggest that you look in to using for example Wildmatch() to identify which wildcard string the compared value matches. In combination with Pick() you can then pick a specific expression to execute depending on the outcome of your WildMatch().
is John or john (first J is capital)?
Hi,
Try like this
if(Lower([field]) like 'john*', blue())
OR
if(WildMatch(Lower([field]), 'john*'), blue())
Hope this helps you.
Regards,
jagan.
The reason in this case can be as Enrique points out, but it can also be that [field] does not equal a distinct value. A reference to a field will be calculated in the same way as a Only() call. In this case try running Only([field]) to see that it actually returns a comparable value.
I would like to suggest that you look in to using for example Wildmatch() to identify which wildcard string the compared value matches. In combination with Pick() you can then pick a specific expression to execute depending on the outcome of your WildMatch().
Just a small note. Wildmatch() is case insensitive, so you actually do not have to make the Lower() call in that scenario.
Toni and Jagan,
thank you for the help. That solved it.
Justin
I am glad to hear the issue is resolved. Please remember to mark answers as correct or helpful, so that other community members know that further assistance is not needed.