Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
cancel
Showing results for 
Search instead for 
Did you mean: 
bobbydave
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
alexandros17

just manage the first expression

If(IsNull(sum(Target),

View solution in original post

4 Replies
alexandros17

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)
)

bobbydave
Creator III
Creator III

Doesnt seem to like that.

alexandros17

just manage the first expression

If(IsNull(sum(Target),

View solution in original post

giakoum
Partner
Partner

why don't you use visual cues?