Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikview979
Specialist
Specialist

If condation

Hi experts,

How to write   IF CONDITION in script level ? with example ?

4 Replies
MK_QSL
MVP
MVP

IF(Country = 'A', 'Something', Country) as Country

or

IF(Marks < 40,'Fail',

     IF(Marks >= 40 and Marks < 50,'Pass',    

          IF(Marks >= 50 and Marks < 60,'Second',

                    IF(Marks >= 60,'First')))) as Grade

alexandros17
Partner - Champion III
Partner - Champion III

In the script:

if Condition then
....
Else
...
ENDIF 

In a load:

Load

...

If(cond, true, false) as alia

...

Not applicable

The syntax for the If function is standardised in script and Expression level.

                       If( <Condition> , < Yes- Condition fulfilled> , <No- Condition not Fulfilled>)

The 'Yes' and 'No' parts can be further nested with If Conditions.

E.g. If ( 1=1, 'Yes' , 'No')

Cheers !

Not applicable

If Conditional Function

Syntax for using If condition in presentation layer expression definition or checking condition in a load statement is as follows

If(Condition, then, else)

Eg;

If(BankBalance>5000,'OK','Fund your account')

If conditions can be nested as follows

Eg:

If(Condition, then, if(Condition, then, if(Condition, then)))

If else is not specified, QlikView will return NULL.

If..then control statement

This forces QlikView to execute different script statements depending on one or more logical conditions

Syntax:

If condition then

statements

elseif condition then

statements

else

statements

​endif


Here, elseif and else are optional. Please refer QlikView desktop help for more details and examples.


Regards,

KKR