Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
neha_sri
Contributor III

If- else condition in expressions


As I am new to qlikview,I want to ask that I want to put condition in expression not in load script.How can I do that?

3 Replies
MVP
MVP

Re: If- else condition in expressions

From help:

if(condition , then , else)

The three parameters condition, then and else are all expressions.
The first one, condition, is interpreted logically.
The two other ones, then and else, can be of any type. They should preferably be of the
same type. If condition is true, the function returns
the value of the expression then. If condition is false, the function returns the value of the
expression else.

Example:

if( Amount>= 0, 'OK', 'Alarm' )

MVP & Luminary
MVP & Luminary

Re: If- else condition in expressions

Hi,

Try like this

Simple If

=If(Condition1, True Expression, False Expression)

Nested If

=If(Condition1, True Expression1, If(Condition2, True Expression2, False Expression))

Hope this helps you.

Regards,

Jagan.

Not applicable

Re: If- else condition in expressions

Use a simple if expression as mentioned by jagan in the expression box, if there is any syntax errors the window itself will highlight whether the expression entered is correct or not. If syntax is correct, it will show "Expression OK". You can see this on the top-left of the window.