Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Red Amber else Default

I am writing some code at the moment to say that

When a value is higher than its target, the value turns green and when a value is less than its target, value turns red.

But what if there is no target, the values should stay default (black).

=if(

(if(Unit = '%', num(avg([Value]), '#,##0%'),

   if(Unit = 'Days', num(avg([Value]), '#,##0'),

  num(sum(Target), '#,##0'))))

>= 

(if(Unit = '%', num(avg(Target), '#,##0%'),

   if(Unit = 'Days', num(avg(Target), '#,##0'),

  num(sum(Target), '#,##0')))),

  

  vGreen, vRed)

Is there a way of adding if target is blank, the values stay black

TargetValueValue
573
638
77
1 Solution

Accepted Solutions
Highlighted

just manage the first expression

If(IsNull(sum(Target),

View solution in original post

4 Replies
Highlighted

something like this:

=If(IsNull(sum(Target), rgb(255,255,255),

if(

(if(Unit = '%', num(avg(
[Value]), '#,##0%'),

if(Unit = 'Days', num(avg(
[Value]), '#,##0'),

num(sum(Target), '#,##0'))))

>=

(if(Unit = '%', num(avg(Target), '#,##0%'),

if(Unit = 'Days', num(avg(Target), '#,##0'),

num(sum(Target), '#,##0')))),



vGreen, vRed)
)

Highlighted
Creator III
Creator III

Doesnt seem to like that.

Highlighted

just manage the first expression

If(IsNull(sum(Target),

View solution in original post

Highlighted
Partner
Partner

why don't you use visual cues?