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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
RA6
Creator
Creator

[Tmap Error] NumberFormatException: For input string

Hello,

 

There's a simple job below:

0683p000009LydY.jpg

Here is my input csv:

0683p000009LyqM.jpg

 

My Tmap in details:

0683p000009LyqR.jpg

 

Condition1 is working well which remove space and replace comma with dot and null to "0:

 

row1.newColumn1==null | row1.newColumn1.equals("")?"0":
row1.newColumn1.contains(",")?row1.newColumn1.replace(",", "."):
row1.newColumn1.contains(" ")?row1.newColumn1.replace(" ", ""):
row1.newColumn1 

 

Condition2 is working well too (same as condition one)

 

row1.newColumn2==null | row1.newColumn2.equals("")?"0":
row1.newColumn2.contains(",")?row1.newColumn2.replace(",", "."):
row1.newColumn2.contains(" ")?row1.newColumn2.replace(" ", ""):
row1.newColumn2 

Condition3: ERROR found: (Trying to keep value to two decimal place and of type string)

String.format("%.5f", (Double.parseDouble(Var.var1) - Double.parseDouble(Var.var2))) 

0683p000009LyjX.jpg

 

Tried hard but couldn't identify the issue.

 

Can you advice please?

 

Thank you very much.

 

Labels (2)
1 Solution

Accepted Solutions
manodwhb
Champion II
Champion II

@asadasing,can you re-write cloumn1 and cloumn2,variable expressions as below.should work if you have space issue.

 

row3.newColumn2==null | row3.newColumn2.equals("")?"0"0683p000009MPcz.pngrow3.newColumn2.replace(",",".")).replace(" ","")

View solution in original post

6 Replies
manodwhb
Champion II
Champion II

@asadasing,cant you try to convet to Float instead of Double,your issue will be resloved.

example:-

Float.parseFloat()

RA6
Creator
Creator
Author

Do you know the reason of this error?
It was working fine before.
RA6
Creator
Creator
Author

The solution you provided is not working.

 

I have tried to convert using float and encountering same error.

 

Float.valueOf(String)

 

And also

 

Float.parseFloat(String)

 

Can you advice please?

manodwhb
Champion II
Champion II

@asadasing,your have space or tab between 1 and 4 of 1 430.76. becuase of the your were getting error,you nee to replace that with empty.

manodwhb
Champion II
Champion II

@asadasing,can you re-write cloumn1 and cloumn2,variable expressions as below.should work if you have space issue.

 

row3.newColumn2==null | row3.newColumn2.equals("")?"0"0683p000009MPcz.pngrow3.newColumn2.replace(",",".")).replace(" ","")

RA6
Creator
Creator
Author

This one works fine.

Indeed the contain function (.contain) was not working OR it could not recognize the space in the string.

 

Thank you very much. Issue marked as solved.

 

Best regards,

asadasing