Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $400 before Dec 31st: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
smurfstar80
Contributor II
Contributor II

Multiple IF statements for a background color expression

I have a data table with addresses where I need to look for and abbreviate certain words, in various countries.

I have created an IF statement that works, but only for 1 country;

However, I have tried various ways of adding further IF statements to this for the other countries, but they seem to cancel each other out.

So basically I have 5 country codes (AT, BE, GB, NL, DE)  each with it's own set of words that I would like to highlight when that particular country code is selected from the 'CountryFilter' field.

Is it possible to insert multiple if statements here, or is there a better way of going about this?

Any suggestions would be much appreciated.

1 Solution

Accepted Solutions
prat1507
Specialist
Specialist

Probably this

pick(match(CountryFilter,'AT','BE','GB', 'NL', 'DE'),

if(wildmatch(Address,.........),red()),

if(wildmatch(Address,.........),blue()),

.......and so on


Regards

Pratyush

View solution in original post

5 Replies
dilipkumard12
Creator
Creator

Dear John,

U can add into master dimensions and U have options to chose your Colours and Add into chart as Library Colours.

Gysbert_Wassenaar

I'd add an extra field in the script when loading the data and store the color value in that field. You could then use that new field to set the background color in the front end table.


talk is cheap, supply exceeds demand
prat1507
Specialist
Specialist

Probably this

pick(match(CountryFilter,'AT','BE','GB', 'NL', 'DE'),

if(wildmatch(Address,.........),red()),

if(wildmatch(Address,.........),blue()),

.......and so on


Regards

Pratyush

smurfstar80
Contributor II
Contributor II
Author

This works exactly how I want it to, as long as the country codes match the order of the IF statements.

Thank you so much for your suggestion

John

prat1507
Specialist
Specialist

Glad to help!

Regards

Pratyush