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

 

  • Talend Integration Cloud
1 ACCEPTED SOLUTION

Accepted Solutions
Six Stars sgv
Six 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()) )

)

12 REPLIES
Six Stars sgv
Six 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

Six Stars sgv
Six 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 .

Nine Stars TRF
Nine 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]

Six Stars sgv
Six 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]

Six Stars sgv
Six 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()) )

)

Six Stars

Re: tFilterrow Advanced condition

sgv,

 

this worked like a charm.

 

thanks 

Six Stars sgv
Six Stars

Re: tFilterrow Advanced condition

Yessssss !!!!!  Smiley Very Happy

 

Good luck for the continuation,

 

SGV