Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
patriciousa
Creator II
Creator II

Color background expression when filtering by tables.

Hi Community.

I'm trying to build a "complex "color background expression.

I have these 2 tables in the same sheet. (The tables have more info.....)

DateDay

Extra Hours

20/02/2016Saturday80
20/03/2016Sunday10
17/01/2016Sunday50

WorkerExtra Hours
Patrick40
Leo10

When I pick the second Table, by Worker, in this case PATRICK. I get the following in the first table.

DateDay

Extra Hours

20/02/2016Saturday12
20/03/2016Saturday8
17/01/2016Saturday4

I need a color background expression that does the following:

If Saturday extra hours over 4, yellow, over 8 orange, over 10, red.

The thing is that the color expression should not apply until you pick a worker.

Is it possible?

Thank you in advance.

Regards.

15 Replies
patriciousa
Creator II
Creator II
Author

You rock Sunny.

Thank you!

sunny_talwar

I just fine tuned Gysbert's expression. He is the one who rock

patriciousa
Creator II
Creator II
Author

Can I make a new question here? Is related to the same information.

What I have now thank to you 2 guys, is a table that when filtered by a worker I get the in the other table, a background color expression when the worker exceeds X amount of hours.

What I need now, in the first table, (where I pick the worker) is that the table has to let me know that I have to pick THAT WORKER because he has a day where he exceeds X amount of hours.

I hope I was clear enough.

sunny_talwar

How do you visualize this? Can you draw a draft in Excel or may be on a paper?

patriciousa
Creator II
Creator II
Author

DateDay

Extra Hours

20/02/2016Saturday80
20/03/2016Sunday10
17/01/2016Sunday50

WorkerExtra Hours
Patrick40
Leo10

Whe I pick Patrick I get the following thanks to the background color expression you guys gave me:

(

if(GetSelectedCount(Nombre)=1,

     If(Sum({<"NombreHoraExtra"={"Hora Extra 100"}>} Cantidad)>12,Red(),

          if(Sum({<"NombreHoraExtra"={"Hora Extra 100"}>} Cantidad)>8, rgb(255,128,0) ,

               if(Sum({<"NombreHoraExtra"={"Hora Extra 100"}>} Cantidad)>4, Yellow(),
              
               if(Sum({<"NombreHoraExtra"={"Hora Extra 100"}>} Cantidad)<=4, Green(),
              
              
               )))))

DateDay

Extra Hours

20/02/2016Saturday12
20/03/2016Saturday8
17/01/2016Saturday4

Withouth making any filter, I need the Extra Hours of Patrick in this chart to be RED so I know that I have to check Patrick's hours.

WorkerExtra Hours
Patrick40
Leo10

Thank you.

Regards.

patriciousa
Creator II
Creator II
Author

I just answered to my own post. I'm letting you know because I don't know if Qlik Forum will update you if I don't reply directly to you.

Thank you.

Take a look in the post below this one.