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, 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())
Try this instead
=If(Concat(Technology, '|'), = '1|2', v_rgb_red, v_rgb_green)
Hi!
I get 'Error in expression'
I wrote '1' and '2' but it should be '1G' and '2G'. Don't know if it matters.
No error but the color is always green, no matter if I select 1G or 2G or both
Would you be able to share an image to show what you are seeing?
See image below:
But does it turn red when both 1G and 2G are selected? Are you also looking for it to turn red when 1G or 2G was selected? When will it show Green? Only if 3G was selected with or without 1G and/or 2G?
@stekol61 may be you have multiple occurrence of value so try with distinct and below condition
=if(GetSelectedCount(Technology)>1,
if(concat(distinct Technology,'|')='1G|2G',red(),
if(concat(distinct Technology,'|')='1G|2G|3G',green())))
Better now.
It should be green if 2G, 3G and 4G is selected and this works
Any other selection should be red