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: 
Not applicable

Syntax dual if statement

Hi i am experiencing a problem with brackets in the following statement.

please advise as both statement work individually.

if(len(trim(SlutKundxOrderKund2.MasterKund))=8

and isnum(left(trim(SlutKundxOrderKund2.MasterKund),4))

and isnum(right(trim(SlutKundxOrderKund2.MasterKund),4)),

left(SlutKundxOrderKund2.MasterKund,4) & '-0000',

if(right(SlutKundxOrderKund2.MasterKund,4) = '0000'

and SlutKundxOrderKund2.Giltig_flagga = 0,

left([SlutKundxOrderKund2.Text 1],9),'Oäkta') as Slutkund

your help is greatly appreciated

Brad

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try adding a final ')' at the end so they all match up:

if(len(trim(SlutKundxOrderKund2.MasterKund))=8

and isnum(left(trim(SlutKundxOrderKund2.MasterKund),4))

and isnum(right(trim(SlutKundxOrderKund2.MasterKund),4)),

left(SlutKundxOrderKund2.MasterKund,4) & '-0000',

if(right(SlutKundxOrderKund2.MasterKund,4) = '0000'

and SlutKundxOrderKund2.Giltig_flagga = 0,

left([SlutKundxOrderKund2.Text 1],9),'Oäkta')) as Slutkund


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar

Try adding a final ')' at the end so they all match up:

if(len(trim(SlutKundxOrderKund2.MasterKund))=8

and isnum(left(trim(SlutKundxOrderKund2.MasterKund),4))

and isnum(right(trim(SlutKundxOrderKund2.MasterKund),4)),

left(SlutKundxOrderKund2.MasterKund,4) & '-0000',

if(right(SlutKundxOrderKund2.MasterKund,4) = '0000'

and SlutKundxOrderKund2.Giltig_flagga = 0,

left([SlutKundxOrderKund2.Text 1],9),'Oäkta')) as Slutkund


talk is cheap, supply exceeds demand