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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

validation not working

There is a minor irritating issue I am facing that I am reading some data from one table and putting in some other table based on just validation as shown below in image. When I am giving row2.ISAPPROVED == "Y" it's not working and when I give row2.ISAPPROVED != null it works!

This is really strange, what or where is the mistake with first condition as I need to use that.

0683p000009LvGM.jpg0683p000009LvMu.jpg

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Write stringchain == "Y" is not good. I think you have a problem with concepts :

 

When you write : stringchain == "Y", you compare the reference of the memory location of "stringchain" and "Y".

 

You must write : stringchain.equals("Y"), so you compare the VALUE of stringchain and the VALUE "Y".

 

 

For solution, you can write :

row2.ISAPPROVED.equals("Y")

but if ISAPPROVED can be null or empty, you can avoid a null pointer exception by writting :

row2.ISAPPROVED != null && row2.ISAPPROVED.equals("Y")

View solution in original post

1 Reply
Anonymous
Not applicable
Author

Write stringchain == "Y" is not good. I think you have a problem with concepts :

 

When you write : stringchain == "Y", you compare the reference of the memory location of "stringchain" and "Y".

 

You must write : stringchain.equals("Y"), so you compare the VALUE of stringchain and the VALUE "Y".

 

 

For solution, you can write :

row2.ISAPPROVED.equals("Y")

but if ISAPPROVED can be null or empty, you can avoid a null pointer exception by writting :

row2.ISAPPROVED != null && row2.ISAPPROVED.equals("Y")