Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Mitz
Contributor II
Contributor II

For input string: "0641009B" Error

Hi,

I would like to seek some help about the error I am getting below.

Initially my concern was to remove the preceding zero values from the field - SerialNum. The expression worked from the other columns, so no more preceding zero values.

To remove the preceding zeros:

StringHandling.LEFT(row2.SERIALNUM,1).equals("0")?

Integer.toString(Integer.parseInt(row2.SERIALNUM)):row2.SERIALNUM

However, If I applied the expression to the SerialNum column it is giving me an error below.

Exception in component tMap_1

java.lang.NumberFormatException: For input string: "0641009B"

I tried to change the original data type from String to Char when loading it to Snowflake, but still, it won't work. It says, "cannot convert string to char".

Do you have any idea how to resolve it?

Thank you in advance.

Labels (4)
1 Reply
jeoste
Creator
Creator

Hello,

Try to parse your data into String with tConvertType before apply the ternary if. Once all your data are into String type tou can apply your ternary if.

If you need after the transformation, you can parse into Int depending if the source accepts Int or String.

This error tells you that 'B' is not a numerical, so you can't change type from String to Int for this kind of data