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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Null pointer error using IF statement

Hi,

 

I have situation where I have to look at a particular column. if my rating is A or B, I have populate the new rating column as Yes else blank. i.e.

ID Rating New Rating
3453 A Yes
3454 B Yes
3455 AA  
3456    
3457 BB  
3458 B Yes
3459 B Yes
3460 A Yes
3461 A Yes
3462    

 

 

I wrote this statement in tmap :

New Rating = row2.Rating.equals("A")||row2.Rating.equals("B")?"Yes":""

but it throws

Exception in component tMap_1 (test1)

java.lang.NullPointerException

at

local_project.test1_0_1.test1.tFileInputExcel_2Process(test1.java:13291)

at local_project.test1_0_1.test1.runJobInTOS(test1.java:17157)

at local_project.test1_0_1.test1.main(test1.java:16994)

 

What M I doing wrong..? thanks for help!

 

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

This can be closed now. I figured out the problem. It was due to no values in rating column.

View solution in original post

2 Replies
Anonymous
Not applicable
Author

This can be closed now. I figured out the problem. It was due to no values in rating column.

Anonymous
Not applicable
Author

Hello,

Thanks for letting us know this issue has been fixed.

Best regards

Sabrina