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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
jasmeenkr
Contributor
Contributor

Multiple if else on field load script qliksense

Hi All,

I have requirement to create custom field load script in qlik sense with conditions like 

(if field like 'Power* ( if field1 is null , then field2+field3 else field 1 ))

 

how to achieve it

 

 

Labels (1)
4 Replies
dplr-rn
Partner - Master III
Partner - Master III

the format is if(condition , then , else)

not compactly clear on the logic you need but hopefully below can give you a start

load field,field1,.................

if(wildmatch(field,'Power*')=1,

      ,   if(isnull(field1),field2+field3 , field 1 )

     , else_condition_to_like_power) as NewColumnName

 

you can either put in the simple load statement or as a preceding load

 

https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ConditionalFun...

jasmeenkr
Contributor
Contributor
Author

The logic is like

If(Field like 'Power' and field1 is null then PM+field3)

else if(Field like 'File' and field1 is null then field2+field3

else if (Field like 'Sys' then field2+field3)

how to achieve this in Qlik sense load script

dplr-rn
Partner - Master III
Partner - Master III

something like below

If(wildmatch(field,'Power*')=1 and isnull(field1) , PM+field3,

                 if(wildmatch(field,'file*')=1 and isnull(field1), field2+field3,

                 if (wildmatch(field,'Sys*')=1, field2+field3)))

dplr-rn
Partner - Master III
Partner - Master III

mark as answered if the answers helped