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: 
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
Luminary Alumni
Luminary Alumni

This should work...

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

Thanks,

DV

View solution in original post

8 Replies
IAMDV
Luminary Alumni
Luminary Alumni

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

Hi,

You need to write

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

Rgds

Anand

its_anandrjs

Hi,

Use this

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

Rgds

Anand

SunilChauhan
Champion
Champion

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

Sunil Chauhan
IAMDV
Luminary Alumni
Luminary Alumni

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