Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

what is the syntax for if else in qliksense for visualization

what is the syntax for if else in qliksense for visualization

10 Replies
sunny_talwar

It should be the same one as QlikView

If(Condition, True, False)

undergrinder
Specialist II
Specialist II

Hi Sunny,

It is exactly the same

G.

sunny_talwar

Yes, I believe so

Not applicable
Author

Thanks. Please let me if it is possible to check for a range of values and give different colors. Something like 20-30 and give red color, 30-40 yellow color etc..

sunny_talwar

Sure, try like this:

If(FieldName > 20 and FieldName <= 30, Red(),

If(FieldName > 30 and FieldName <= 40, Yellow(),

If(FieldName > 40, Green())))

simondachstr
Luminary Alumni
Luminary Alumni

if else should generally be your option of last resort when it comes to writing expressions.

Not applicable
Author

if((Sum()/Sum()) < 0.3,red(),

if((Sum()/Sum()) > 0.4,Blue()),

if((Sum()/Sum()) > 0.5,Green()))

This is giving syntax error? If I comment the last line and adjust the brackets it works properly. But when I put the last line it gives error?

Anonymous
Not applicable
Author

If(FieldName > 20 and FieldName <= 30, Red(),

If(FieldName > 30 and FieldName <= 40, Yellow(), Green()

))

please try this

sunny_talwar

May be you need another parenthesis at the end to close the first if:

if((Sum()/Sum()) < 0.3,red(),

    if((Sum()/Sum()) > 0.4,Blue()),

          if((Sum()/Sum()) > 0.5,Green()

          )

    )

)