Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Sunil_Kenth
Former Employee
Former Employee

Expression Help

I am trying to colour the background of a cell in a straight table if the dimension equals a certain value.

I have clicked on + sign next to my demonsion name and then double clicked on Background and entered the following expression:

=if(((Brand)"Mazda"), LightRed)

I get the message saying error in expression.

Can you tell me what i'm doing wrong?

Thanks,

Sunil

1 Solution

Accepted Solutions
IAMDV
Master II
Master II

This should work...

=if(Brand = 'Mazda', LightRed())

Thanks,

DV

View solution in original post

8 Replies
IAMDV
Master II
Master II

This should work...

=if(Brand = 'Mazda', LightRed())

Thanks,

DV

Sunil_Kenth
Former Employee
Former Employee
Author

Got it working using the following expression:

=if( Brand = 'Mazda', green(),
if( Brand = 'Ford', green(),
if( Brand = 'BMW', green(),white()
)))

its_anandrjs
Champion III
Champion III

Hi,

You need to write

=IF( Brand = 'Mazda', Lightred())

Rgds

Anand

its_anandrjs
Champion III
Champion III

Hi,

Use this

=If( Brand = 'Mazda' or Brand = 'Ford' or Brand = 'BMW', green(),white())

Rgds

Anand

SunilChauhan
Champion II
Champion II

if(((Brand)="Mazda"), Rgb(255,102,102))

Sunil Chauhan
IAMDV
Master II
Master II

Sunil - If you have massive dataset, then you need to Load the Colors within the Script instead of using the IF  - conditional statement. This will improve the performance compared to using the IF statements.

I hope this helps!

Cheers - DV

Sunil_Kenth
Former Employee
Former Employee
Author

Thanks DV.

The data set isn’t that huge so it’s performance is fine.

Thanks,

Sunil

Not applicable

As a matter of performance, try avoid using 'if' and use pick/match instead:

pick(match(Brand, 'Mazda'), lightred())

Regards,

Gordon