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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

if condition in load script

I have two Fields

FieldA has two values A and B

FieldB has Y and N

FieldC has numbers.

I am trying to fetch values from FieldC based on condition on FieldA and FieldB in the Load Script as below:

if([FieldA]='A' and [FieldB]='Y', [FieldC])

If FieldA has A and FieldB has Y as values, then the column FieldC should get all the values corresponding to the condition. But I get this error saying Invalid Expression. How to achieve this in Load Script level.

22 Replies
vikramv
Creator III
Creator III

As per your requirement , Sunny' solutions should work ...

Qrishna
Master
Master

Try Below:

Data:

Load IF(FieldA='A' and FieldB = 'Y', FieldC) as FieldC;

Load * Inline [

FieldA, FieldB, FieldC

A,Y,1

B,Y,2

C,N,3

A,N,4

A,Y,5

B,Y,6

C,Y,7

];

//You can replace the Inline code with your own Data load

sunny_talwar