Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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 (3)
4 Replies
Highlighted
Partner
Partner

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...

Highlighted
Contributor
Contributor

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

Highlighted
Partner
Partner

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)))

Partner
Partner

mark as answered if the answers helped