tFilterrow Advanced condition

Six Stars

tFilterrow Advanced condition

Hello there,

 

I am trying to put two conditions between or but it is not giving expected results. please help

 

Query:

!(input_row.Status.equals(null)) && !(input_row.Status.equals("")) ||    ----- This condition works but if i put && instead of or then it throw nullpointer error

(input_row.Status.equals("Opt-out") && input_row.SF_ID.equals(""))

 

I am enclosing a screenshot, the highlighted row should not appear in the results 

 

thanks in advance

 


Accepted Solutions
Eight Stars sgv
Eight Stars

Re: tFilterrow Advanced condition

(

(input_row.Status != null )

&&

(! input_row.Status.isEmpty())

&&

! ( (input_row.Status.equals("Opt-out")) && (input_row.SF_ID == null) )

&&

! ( (input_row.Status.equals("Opt-out")) && (input_row.SF_ID.isEmpty()) )

)

View solution in original post


All Replies
Eight Stars sgv
Eight Stars

Re: tFilterrow Advanced condition

Hello,

 

can you try with  :

 

(input_row.Status != null) && !(input_row.Status.equals("")) || (input_row.Status.equals("Opt-out") && input_row.SF_ID.equals(""))

 

good luck

SGV

Six Stars

Re: tFilterrow Advanced condition

Hey SGV,

 

thanks for the reply but it is still the same 

 

A

Eight Stars sgv
Eight Stars

Re: tFilterrow Advanced condition

Oh NOOO

i get it ! You want to print if :

 

( (input_row.Status != null ) && (! input_row.Status.isEmpty()) && ( (input_row.Status.equals("Opt-out") && !(input_row.SF_ID.isEmpty()) ) )

 

I think, it's what you want .

Highlighted
Sixteen Stars TRF
Sixteen Stars

Re: tFilterrow Advanced condition

please clarify the expected expression:
- A || B && C
- (A || B) && C
- ...

TRF
Six Stars

Re: tFilterrow Advanced condition

sgv,

 

here is the error, i tried but then i get null pointer, thought of send it back to expert Smiley Happy

 

Execution failed : Job compile errors
At least job "VALLDATA_FILE_CONSENT" has a compile errors, please fix and export again.
Error Line: 2962
Detail Message: Syntax error, insert ")" to complete ArgumentList
There may be some other errors caused by JVM compatibility. Make sure your JVM setup is similar to the studio.
Job VALLDATA_FILE_CONSENT ended at 13:59 12/09/2017. [exit code=0]

Six Stars

Re: tFilterrow Advanced condition

Fred,

 

Is that a Riddle? sorry didn't understand

Six Stars

Re: tFilterrow Advanced condition

I tried this expression but got error

 

 

 (!(input_row.Status.equals(null)) && !(input_row.Status.equals("")) ) && (input_row.Status.equals("Opt-out") && input_row.SF_ID.equals(""))  

 

 

[statistics] connecting to socket on port 3368
[statistics] connected
Exception in component tFilterRow_20
java.lang.NullPointerException
at rspca.valldata_file_consent_0_1.VALLDATA_FILE_CONSENT.tOracleInput_1Process(VALLDATA_FILE_CONSENT.java:3054)
at rspca.valldata_file_consent_0_1.VALLDATA_FILE_CONSENT.runJobInTOS(VALLDATA_FILE_CONSENT.java:3680)
at rspca.valldata_file_consent_0_1.VALLDATA_FILE_CONSENT.main(VALLDATA_FILE_CONSENT.java:3440)
[FATAL]: rspca.valldata_file_consent_0_1.VALLDATA_FILE_CONSENT - tFilterRow_20 null
[statistics] disconnected
Job VALLDATA_FILE_CONSENT ended at 14:08 12/09/2017. [exit code=1]

Eight Stars sgv
Eight Stars

Re: tFilterrow Advanced condition

(

(input_row.Status != null )

&&

(! input_row.Status.isEmpty())

&&

! ( (input_row.Status.equals("Opt-out")) && (input_row.SF_ID.isEmpty()) )

)

 

...

Six Stars

Re: tFilterrow Advanced condition

sgv,

 

i tried the new expression and here is the error

 

[statistics] connecting to socket on port 4010
[statistics] connected
Exception in component tFilterRow_20
java.lang.NullPointerException
at rspca.valldata_file_consent_0_1.VALLDATA_FILE_CONSENT.tOracleInput_1Process(VALLDATA_FILE_CONSENT.java:3063)
at rspca.valldata_file_consent_0_1.VALLDATA_FILE_CONSENT.runJobInTOS(VALLDATA_FILE_CONSENT.java:3691)
at rspca.valldata_file_consent_0_1.VALLDATA_FILE_CONSENT.main(VALLDATA_FILE_CONSENT.java:3451)
[FATAL]: rspca.valldata_file_consent_0_1.VALLDATA_FILE_CONSENT - tFilterRow_20 null
[statistics] disconnected
Job VALLDATA_FILE_CONSENT ended at 14:17 12/09/2017. [exit code=1]

Eight Stars sgv
Eight Stars

Re: tFilterrow Advanced condition

(

(input_row.Status != null )

&&

(! input_row.Status.isEmpty())

&&

! ( (input_row.Status.equals("Opt-out")) && (input_row.SF_ID == null) )

&&

! ( (input_row.Status.equals("Opt-out")) && (input_row.SF_ID.isEmpty()) )

)

View solution in original post

Six Stars

Re: tFilterrow Advanced condition

sgv,

 

this worked like a charm.

 

thanks 

Eight Stars sgv
Eight Stars

Re: tFilterrow Advanced condition

Yessssss !!!!!  Smiley Very Happy

 

Good luck for the continuation,

 

SGV

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog