Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
adiarnon
Creator III
Creator III

expression effectively

hi,

i have this expression-

if((sum(amount)-sum(budget))/number <10,'red',

     if((sum(amount)-sum(budget))/number <30,'yellow',

             if((sum(amount)-sum(budget))/number <50,'green',

                       if((sum(amount)-sum(budget))/number <70,'blue',

                                   if((sum(amount)-sum(budget))/number <100,'purple')))))

The calculation time of the expression is very long and therefore I wanted to know whether it is possible to write the expression more effectively...

Because the expression (sum(amount)-sum(budget))/number) in each of the if conditions is the same


(something like Match in string)


can someone help?

adi

3 Replies
petter
MVP
MVP

You could always do:

=Pick(Floor(

((sum(amount)-sum(budget))/number)

/10)+1,'red','yellow','yellow','green','green','blue','blue','purple','purple','purple')

This doesn't account for negative values so it needs more fine-tuning I guess....

adiarnon
Creator III
Creator III
Author

its not always interval of 10...

adiarnon
Creator III
Creator III
Author

someone have an idea?