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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
JM39
Creator
Creator

Job started producing java.lang.NullPointerException error

Hello, I really need some help with this because it's really driving me mad.  I had two jobs which previously (around a week ago) were running perfectly.  I haven't changed the input file or anything else.  Today I go to run it and it produces the dreaded java.lang.NullPointerException error.

 

I have an excel input file.  I think what's causing the issue is this part in my tMap

 

row2.CountryCode.equals("")?
"MAIN_PURCH" :
(row2.CountryCode.equals("GB"))&&row1.Postcode!=null ?
row1.Postcode :
row2.CountryCode+"_MAIN_PURCH"

 

What I'm saying here is if the country code is blank, then MAIN_PURCH, else if

the country code is GB and the postcode is not null then use the postcode, else

Country Code+Main_PURCH

 

Appreciate any input!

I imagine I'm going to be told there's null values in my source data, but what I don't understand is that I haven't changed the input file & it was running before.

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Try this...

row2.CountryCode==null || row2.CountryCode.equals("")?
"MAIN_PURCH" :
(row2.CountryCode.equals("GB"))&&row1.Postcode!=null ?
row1.Postcode :
row2.CountryCode+"_MAIN_PURCH"

It sounds like your CountryCode may be null instead of an empty String.

View solution in original post

4 Replies
Anonymous
Not applicable

Try this...

row2.CountryCode==null || row2.CountryCode.equals("")?
"MAIN_PURCH" :
(row2.CountryCode.equals("GB"))&&row1.Postcode!=null ?
row1.Postcode :
row2.CountryCode+"_MAIN_PURCH"

It sounds like your CountryCode may be null instead of an empty String.

Anonymous
Not applicable

Try this...

row2.CountryCode==null || row2.CountryCode.equals("")?
"MAIN_PURCH" :
(row2.CountryCode.equals("GB"))&&row1.Postcode!=null ?
row1.Postcode :
row2.CountryCode+"_MAIN_PURCH"

It sounds like your CountryCode may be null instead of an empty String.

JM39
Creator
Creator
Author

That's worked, thank you!

JM39
Creator
Creator
Author

That's worked, thank you!