Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with the setting of the background color for an expression

Hi, i met with an issue when trying to set the background color for an expression. Please refer to the attached QVW file for further information. In the QVW, i set the background color of the expression to show light green for country = 'USA' while others will show in light grey.

In addition to the straight table, i also have a list box which let the users to choose those countries they would like to exclude from the straight table. The problem is when i make any selection to the list box, the color assignment for the expression seems to not working anymore. Kindly please let me know how to solve this issue. Thanks so much!

1 Solution

Accepted Solutions
danielblank
Partner - Contributor III
Partner - Contributor III

Hi,

your expression is almost ok, but the problem is you are trying to exclude values over the same field.

My approach would be to create a detached table with all the values you want to exclude.

I used the following load statement:

country_exclusion:

load * inline [

country_ex

USA

China

Taiwan

German

France

Singapore

];

After reload I would adjust the expression:

sum({$<country = {"*"} - {$(=GetFieldSelections(country_ex, ',', 10))}>} kpi)

Now load the field country_ex into the listbox on the surface and that should do the trick.

Hope that helps!

View solution in original post

2 Replies
danielblank
Partner - Contributor III
Partner - Contributor III

Hi,

your expression is almost ok, but the problem is you are trying to exclude values over the same field.

My approach would be to create a detached table with all the values you want to exclude.

I used the following load statement:

country_exclusion:

load * inline [

country_ex

USA

China

Taiwan

German

France

Singapore

];

After reload I would adjust the expression:

sum({$<country = {"*"} - {$(=GetFieldSelections(country_ex, ',', 10))}>} kpi)

Now load the field country_ex into the listbox on the surface and that should do the trick.

Hope that helps!

Not applicable
Author

Thanks Daniel