Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to highlight Background color across a bunch of expressions

I have two dimension and 8 expressions in a pivot table.

I am trying to highlight the background color for the expression that has the highest value of all the expressions on each row for that dimension value (TestName).  So, for Sunspider, it would be Exp7, I would want a blue background for that best one.  I am not sure how to consider the 8 expressions columns on a row in the code as a set.

Anybody have any ideas how to do that? 

accrossRowsQlikview.PNG

1 Solution

Accepted Solutions
Not applicable
Author

If you allow the pivot table to create the expressions, as opposed to manullay creating the expressions in your example, you can use the Aggr function to find the maximum across your dimension, and then compare that to your results within the Background Color of your expression.

If( Sum(Results) = Aggr(NODISTINCT Max(Results),TestName), LightBlue() )

I've attached your qvw example to show this.

View solution in original post

15 Replies
rahulgupta
Partner - Creator III
Partner - Creator III

Hey Hi,

As you are using pivot table, goto the exression tab nad click the '+' sign at the start of each Expression, there you will find the background color option >> write an exression over there(eg if(sum(Sales)>10000,green(),red())

In case of straight table, use Visual Cues.

Hope this helps

Regards

its_anandrjs

Hi,

See the attached sample file there you find the code for Background and text color also. Just click on + sign on front of the expression and you find several option select Background Color to change back color,to change text color select Text Color and write code there.

Regards

Anand

Not applicable
Author

Thanks for the input.  setting the background color is understood, how  to compare accross expressions is the question I have.  

its_anandrjs

Hi,

In this case you need to create a different variables for the expression and need to check the condotion that you see on the Background option from there same like check the condition and give color to the condition. Do you have any sample if so please provide it goes so easy.

Regards,

Anand

Not applicable
Author

Here is Qlikview file that, one chart. Trying to color background light blue for the best in class on each row.

Not applicable
Author

Are you suggesting turn each expression formula into a variable and then do an:

if (   NumMax(  $(vExpr1), $(vExpr2), $(vExpr3),... = $vExpr1  ), rgb(255,0,.0)  )  in the Background? 

Not applicable
Author

If you allow the pivot table to create the expressions, as opposed to manullay creating the expressions in your example, you can use the Aggr function to find the maximum across your dimension, and then compare that to your results within the Background Color of your expression.

If( Sum(Results) = Aggr(NODISTINCT Max(Results),TestName), LightBlue() )

I've attached your qvw example to show this.

Not applicable
Author

Seems that would be perfect… Missed a point somewhere, did not know we could put dimension across the top on the horizontal… Not sure how to do that yet, how did you do it?

Not applicable
Author

Think I figured it out, select, get the hand and do a drag and drop of sorts…. Hmmm