Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
trishita
Contributor III

Condition with colour functions

I have two parameters and want to create  an expression with condition cases and colour background on basis of it

It would be kind of nested IF loop:

if(field='Correction Done')

then

   case 1:

    (Deviation after sounding==Difference Vs Log Survey) then green()

case 2:

    (Deviation after sounding - Difference Vs Log Survey ) !=0 then yellow()

else

   red()  //´(field='Correction  Not  Done')

I am not sure with the syntax.And where should I use to generate a  graph with this function?

5 Replies
Highlighted
olivierrobin
Valued Contributor III

Re: Condition with colour functions

hello

in your graph, expression tab

for each expression, if youpress then +,you have 2 options background color, text color

you can code an expression

if(field='Correction Done',

     if([Deviation after sounding]=[Difference Vs Log Survey],

        green(),

        if([Deviation after sounding] - [Difference Vs Log Survey]<>0,

             yellow(),

             red() 

          ),

        red() 

)

Highlighted
trishita
Contributor III

Re: Condition with colour functions

do I need this red in the above code as u had mentioned or was it a typo:

if(field='Correction Done',

     if([Deviation after sounding]=[Difference Vs Log Survey],

        green(),

        if([Deviation after sounding] - [Difference Vs Log Survey]<>0,

             yellow(),

             red()  ---< is this a typo as I want red to be only when the field is Correction Not done

          ),

        red() 

Highlighted
olivierrobin
Valued Contributor III

Re: Condition with colour functions

you're right

but you have to replace it by another color in case the above condition is false

Highlighted
trishita
Contributor III

Re: Condition with colour functions

Hi,

the syntax is showing error in expression

Highlighted
trishita
Contributor III

Re: Condition with colour functions