Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
snowman
Contributor III
Contributor III

IF OR syntax in Data Manager

Hi there,

In Data Manager I am not sure how to put "IF" and "OR" together:

In this statement, it works:

   If(wi1 = 'R', 'R', 'L')

But when I put Or inside the IF function, I got the error of Missing right parenthesis:

   If(wi1 = 'R' or wi2 = 'R', 'R', 'L')

wi1 and wi2 are data fields with either 'R' or 'L'

Wonder what should be the appropriate syntax as the parenthesis should be OK.

 

Thanks

Labels (1)
1 Solution

Accepted Solutions
EliGohar
Partner - Creator III
Partner - Creator III

@snowman 

Your syntax works fine for me:

Table:
LOAD * INLINE [
    wi1, wi2
    'R','L'
    'R','R'
    'L','R'
    'L','L'
];


Table2:
Load *,  If(wi1 = 'R' or wi2 = 'R', 'R', 'L') as condition
Resident Table;

Drop table Table;

 

EliGohar_0-1593068288436.png

 

View solution in original post

2 Replies
EliGohar
Partner - Creator III
Partner - Creator III

@snowman 

Your syntax works fine for me:

Table:
LOAD * INLINE [
    wi1, wi2
    'R','L'
    'R','R'
    'L','R'
    'L','L'
];


Table2:
Load *,  If(wi1 = 'R' or wi2 = 'R', 'R', 'L') as condition
Resident Table;

Drop table Table;

 

EliGohar_0-1593068288436.png

 

snowman
Contributor III
Contributor III
Author

Hi @EliGohar ,

Thanks, and yes when I switched to Data Load Editor after struggling in the Data Manager for hours, the script is OK. Just wonder if there is any limitation in the Data Manager.

Admittedly Data Manager is more easy to use, and since once it is unlocked I cannot go back to Data Manager from the Data Load Editor, I hope I can do all of the data loading tasks there.