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: 
Igor2
Contributor II
Contributor II

Check the first two string characters and despise case starts with..

Hi !!!

I have some string values, and i can't insert into DB the values starts with 'YY...' and 'YT...'.

For example , i need to insert only 'ABABC01':

row1.Field_A

YYABC01

YYABC02

ABABC01

YTABC01

YTABC02

I have to check the first two characters and if equals YY or YT don't insert this lines

How can i do this in a tMap ?

 

I 'm using this on filter:

 

StringHandling.LEFT(row1.Field_A,2)=!'YY' || StringHandling.LEFT(row1.Field_A,2)=!'YT'

 

but i get an error:

INVALID CHARACTER CONSTANT

tks

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi

Please see below.

row1.newColumn.substring(0,2)

 

filter expression:

!(Var.var1.equals("YY")||Var.var1.equals("YT"))

0695b00000KCdRtAAL.png

View solution in original post

2 Replies
Anonymous
Not applicable

Hi

Please see below.

row1.newColumn.substring(0,2)

 

filter expression:

!(Var.var1.equals("YY")||Var.var1.equals("YT"))

0695b00000KCdRtAAL.png

Igor2
Contributor II
Contributor II
Author

shong always saves me thanks 🙂

 

I had to do this modification:

row1.newColumn.substring(0, Math.min(2,row1.newColumn.length())