Six Stars

negation of talend expression

I have a condition in Talend which is negation of contains. so if the field initial_code anything that does not contain text 'rejected while data entry' should be filtered.

5 REPLIES
Ten Stars

Re: negation of talend expression

row1.initial_code==null||StringHandling.INDEX(row1.initial_code,"rejected while data entry")==-1

condition for not contain - You can use it in tMap filter

-----------
Six Stars

Re: negation of talend expression

can we instead use (!row1.initial_code.contains("rejected while data entry")) ?

Ten Stars

Re: negation of talend expression

why not?

-----------
Six Stars

Re: negation of talend expression

And what if we have multiple such criteria? "rejected" and "rejected while data entry"

Ten Stars

Re: negation of talend expression

and what if not? :-)

 

Just test all wanted conditions

take small file which include all variant - tMap -> tLogRow

 

You can combine as many conditions as You need - just must be proper conditions!

 

 

 

-----------