Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
MikeC-12
Contributor II
Contributor II

Qlik Sense change background color on expression using a static row

I have a Qlik Sense dashboard (version Feb 2020) that  I am building.  One of the requirements is to have values less then 0 have a red background.  The issues with this is I am using a static inline column to put the values in.  The calculations I am using are very long and complicated and would prefer not to have to copy them into the background expression to make the color change.  Here is a simplified version of what I am trying to accomplish.
The Data expression is like this:

if (MyRow='Row cars sold', Some calculation 1,

if (MyRow='Row Cars Traded In', Some calculation 2,

if (MyRow='Row Cars Salvaged', Some calculation 3,

If (MyRow='Row Cars Kept', Some calculation 4,

))))

I have tried the following to change the background color but none of them work.  Is there something else I could try?

if ('MyRow' < 0 , Red(), Green())

if (Column(2) < 0, Red(), Green())

if ('[Cars Sold]' < 0 , Red(), Green())

2 Solutions

Accepted Solutions
stevejoyce
Specialist II
Specialist II

you can reference the expression's label.

is that what Cars Sold is?  if so, it wouldn't be in single quotes

if ([Cars Sold] < 0 , Red(), Green())

View solution in original post

stevejoyce
Specialist II
Specialist II

Also column(<measure index>) would work also.  but maybe it wasnt #2.  you put in the measure number, don't count the dimensions.  maybe column(1) would have worked.

View solution in original post

4 Replies
MikeC-12
Contributor II
Contributor II
Author

I apologize, I forgot to mention this is in a simple table.

stevejoyce
Specialist II
Specialist II

you can reference the expression's label.

is that what Cars Sold is?  if so, it wouldn't be in single quotes

if ([Cars Sold] < 0 , Red(), Green())

stevejoyce
Specialist II
Specialist II

Also column(<measure index>) would work also.  but maybe it wasnt #2.  you put in the measure number, don't count the dimensions.  maybe column(1) would have worked.

MikeC-12
Contributor II
Contributor II
Author

Thank you Stevejoyse this worked!!