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: 
zied_ahmed1
Specialist
Specialist

condition in the script

Hello,

I have these fields in a table

Num_dos

Code_file;

i would like to create a field base in the two fields :

Field 3 is when I have Code_file with a Num_dos Null or empty

how to do this

Thank you

1 Solution

Accepted Solutions
zhadrakas
Specialist II
Specialist II

Maybe this:

Load

Num_dos

Code_file,

if(len(trim(Code_file))>0 AND len(trim(Num_dos))=0, 'THEN', 'ELSE') as FIELD_3;

View solution in original post

2 Replies
zhadrakas
Specialist II
Specialist II

Maybe this:

Load

Num_dos

Code_file,

if(len(trim(Code_file))>0 AND len(trim(Num_dos))=0, 'THEN', 'ELSE') as FIELD_3;

rubenmarin

Hi Zied, this can be done in script or using Data Manager to create a calculated field if script is synchronized, the expression can be:

If(not IsNull(Code_file) and IsNull(Num_dos), 'ValueForTrue', 'ValueForFalse') as Field3

Edit: better use the Len(Trim()) option to handle empty values.