Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

If Else If Else ?

Hi All,

I am in need to use If Else If Elseconditon in my application..

please share the application ..

Regards,

Helen

4 Replies

Re: If Else If Else ?

neetha_p
Honored Contributor

Re: If Else If Else ?

Hi,

Please can you be more specific of what you need.

May be give details like - you need a if else condition

in load script or in chart expressions.

Regards

Nitha

Re: If Else If Else ?

Hi,

There are so many ways of using the if else if condition some are in the load script and some are expressions but in expression if condition has not good performance. But in load you can use it many ways check the below discription from the help and small examples.

If..then..elseif..else..end if

The if..then control statement is a script selection construct forcing the script execution to follow different paths depending on one or several logical conditions. The syntax is:

if condition then

  [ statements ]

{ elseif condition then

  [ statements ] }

[ else

  [ statements ] ]

end if

Where:

condition is a logical expression which can be evaluated as true or false.

statements is any group of one or more QlikView script statements.

Since the if..then statement is a control statement and as such is ended with either a semicolon or end-of-line, each of its four possible clauses (if..then, elseif..then, else and end if) must not cross a line boundary.

Examples:

Let a = 1;

if a=1 then

load * from abc.csv;

sql select e, f, g from tab1;

end if

if a=1 then; drop table xyz; end if;

if x>0 then

load * from pos.csv;

elseif x<0 then

load * from neg.csv;

else

load * from zero.txt;

end if

Hope this helps

Highlighted
Employee
Employee

Re: If Else If Else ?

As script statement

IF <condition> THEN

    statement1

ELSE

    IF <condition2> THEN

      statement2

    ELSE

          statement3

     ENDIF

ENDIF

as an expression

IF(<condition>,expression1,if(<condition2>,expression2,expression3))

Community Browser