Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
ishchopra
Contributor III
Contributor III

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

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

(

(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

12 Replies
Anonymous
Not applicable

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

ishchopra
Contributor III
Contributor III
Author

Hey SGV,

 

thanks for the reply but it is still the same 

 

A

Anonymous
Not applicable

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 .

TRF
Champion II
Champion II

please clarify the expected expression:
- A || B && C
- (A || B) && C
- ...
ishchopra
Contributor III
Contributor III
Author

sgv,

 

here is the error, i tried but then i get null pointer, thought of send it back to expert 0683p000009MACn.png

 

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]

ishchopra
Contributor III
Contributor III
Author

Fred,

 

Is that a Riddle? sorry didn't understand

ishchopra
Contributor III
Contributor III
Author

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]

Anonymous
Not applicable

(

(input_row.Status != null )

&&

(! input_row.Status.isEmpty())

&&

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

)

 

...

ishchopra
Contributor III
Contributor III
Author

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]