Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a QV app with a Text field.
I want to change the font color based on a filter.
If i select the filter 'Technology' as '1' or '2' or '3' the color should be green.
If i select '1' AND '2' it should be red
I used this expression bet it doesn't work (shows green no matter what filter value I use)
=If (Technology='1' and Technology='2' , v_rgb_red, v_rgb_green)
So, all 3 selected together it should be green? If only 3G is selected? or 3G and 4G selected?
Yes, only 2G, 3G and 4G should be green.
Single value or any other combination, e.g 3G and 4G, should be red
So, then try this
If(Concat(DISTINCT Technology, '|') = '2G|3G|4G', Green(), Red())
@stekol61 Just another option in case your field is not sorted and concat values sequence does not match with hard coded value then for safer side check condition for individual values so that it will work always
=if(wildmatch(GetFieldSelections(Technology),'*2G*') and wildmatch(GetFieldSelections(Technology),'*3G*') and wildmatch(GetFieldSelections(Technology),'*4G*') ,green(),red())
THX, this solved my problem
@Kushal_Chawda why not add a sort parameter for this instead? Have not tested it, but the idea is to give a sort for the Concat function.
If(Concat(DISTINCT Technology, '|', -Rank(Technology)) = '2G|3G|4G', Green(), Red())
@sunny_talwar Yes. We can give it. I just used another method instead without depending on the sorting.