Qlik Community

Qlik Sense Deployment & Management

Discussion board where members learn more about Qlik Sense Installation, Deployment and Management.

zied_ahmed1
Contributor III

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
Valued Contributor

Re: condition in the script

Maybe this:

Load

Num_dos

Code_file,

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

2 Replies
zhadrakas
Valued Contributor

Re: condition in the script

Maybe this:

Load

Num_dos

Code_file,

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

Re: condition in the script

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.

Community Browser