Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Nested if Script Syntax

hi i would like to run the following script in the backend.

my purpose is to merge the two statements into one field. However my syntax seems to be wrong.

both statements work perfectly fine by themselves.

Any help would be greatly appreciated.

if(len(trim(Orderkund))=9 and isnum(left(trim(Orderkund),4)) and isnum(right(trim(Orderkund),4)),left(Orderkund,4) & '-0000'

or

"Giltig_flagga" = 0, (left("Text 1",9))) as EndCustomer

1 Solution

Accepted Solutions
Not applicable
Author

it is a flag that by default is 0, or Null.

View solution in original post

3 Replies
Clever_Anjos
Employee
Employee

I don´t see how "Giltig_flagga" = 0 can be true, you´re comparing  a string to 0, is that?

Not applicable
Author

it is a flag that by default is 0, or Null.

Clever_Anjos
Employee
Employee

=if(len(trim(Orderkund))=9 and isnum(left(trim(Orderkund),4)) and isnum(right(trim(Orderkund),4)),left(Orderkund,4) & '-0000' or  Giltig_flagga = 0, (left('Text 1',9)))

Works here, note that I´m using single quote at 'Text 1' and no quotes at Giltig_flagga