Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Skip the ticket, Chat with Qlik Support instead for instant assistance.
Showing results for 
Search instead for 
Did you mean: 
Not applicable

issue with if condition


I had a if condition in script like

if([field 1] = 'a',  x, [field 2]) as [field 3]

so [field 3] should have value x and [field 2] values as per my knowledge.

But this is not happening in my case.

Can some help on this.



2 Replies
Partner - Champion III
Partner - Champion III

You're correct but with no extra information than this it is hard to know where the problem might be. But the condition has to be within a load statement and all the fields has to exist already in the source table that you load from. Furthermore the and the [field 2] fields has to have these names in the source table - they can't be new field names being created in the same load step.

Could you please provide us for instance with some test data that proves your point or a test app if possible?

Partner - Contributor
Partner - Contributor

Hi Sai,

I totally agree with Petter

As x is value try giving it in quotes :

Something like:

if([field 1] = 'a',  'x', [field 2]) as [field 3]