Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
linhnguyen
Contributor II
Contributor II

Problem to color by dimension

Hello everybody,

I have a question about color by dimension. I have a combo chart with x axis: minutes to complete a job, and y-axis: count(jobs). I want to color one bar which has the minute = avg of delivery time.  I typed the formula in color by dimension (minute). The problem is that if I assign a fixed number, I got the right color code as the photo.

=if(Minutes= 14,'red','rgb(70,124,175)')

But if I change the fixed number to avg(deliverd_date-started_date) => Qlik doesn't understand and turn color in grey.

Could anybody help me?

Thank you so much,

 

 

 

 

 

2 Solutions

Accepted Solutions
lorenzoconforti
Specialist II
Specialist II

can you share the dashboard?

 

View solution in original post

lorenzoconforti
Specialist II
Specialist II

try this:

=if(Minutes =
floor(avg(total if( (CanceledDate-RequestDate)*24*60>0 and match(ErrorCode,'NULL') and isnull(PickedDate-RequestDate),(CanceledDate-RequestDate)*24*60,(DeliveredDate-RequestDate)*24*60)))
,'red','rgb(70,124,175)')

View solution in original post

4 Replies
lorenzoconforti
Specialist II
Specialist II

can you share the dashboard?

 

linhnguyen
Contributor II
Contributor II
Author

Hello,

Thank you for your help. I need help to color the minute = avg delivery time.

The calculation that I used:

=if(Minutes =
floor(avg(if( (CanceledDate-RequestDate)*24*60>0 and match(ErrorCode,'NULL') and isnull(PickedDate-RequestDate),(CanceledDate-RequestDate)*24*60,(DeliveredDate-RequestDate)*24*60)))
,'red','rgb(70,124,175)')

 

lorenzoconforti
Specialist II
Specialist II

try this:

=if(Minutes =
floor(avg(total if( (CanceledDate-RequestDate)*24*60>0 and match(ErrorCode,'NULL') and isnull(PickedDate-RequestDate),(CanceledDate-RequestDate)*24*60,(DeliveredDate-RequestDate)*24*60)))
,'red','rgb(70,124,175)')

linhnguyen
Contributor II
Contributor II
Author

Perfect, it works. Thank you so much.