- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wildcard question
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.
- Tags:
- wildcard
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
is John or john (first J is capital)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Try like this
if(Lower([field]) like 'john*', blue())
OR
if(WildMatch(Lower([field]), 'john*'), blue())
Hope this helps you.
Regards,
jagan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just a small note. Wildmatch() is case insensitive, so you actually do not have to make the Lower() call in that scenario.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Toni and Jagan,
thank you for the help. That solved it.
Justin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.