Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
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

just manage the first expression

If(IsNull(sum(Target),

View solution in original post

4 Replies

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

Creator III
Creator III

Doesnt seem to like that.

just manage the first expression

If(IsNull(sum(Target),

View solution in original post

Partner
Partner

why don't you use visual cues?