Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression to consider just a string

Hi,

I have a table and a field that has a field similar to the one shown below

Data

Yes - ABCD

Yes - XYZ

Yes - QWER

No - ABCD

No - XYZ

I need to get an expression where if the filed values has 'Yes' in it regardless of what's attached to it, the color of the field should be Green, or it must be Red otherwise. Any help how to frame the expression? The expression should only see if the field value has Yes or No regardless of the following data.

6 Replies
sunny_talwar

May be this in background color expression:

If(WildMatch(Data, 'Yes*'), Green(), Red())

swuehl
MVP
MVP

Something like

IF(Data LIKE 'Yes*', Lightgreen(), Lightred() )

Not applicable
Author

Let me try both the expressions and come back with the results. Thanks a lot guys.

Not applicable
Author

Thank you so much both of you. It worked.

satishkurra
Specialist II
Specialist II

If(Data='Yes',Green(),Red())

Or you can even try the below expression for better performance.

=if(complex expression, dual(‘Y’,green()), dual(‘N’,red()))

sunny_talwar

Great, if you got what you were looking for, please close the thread