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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tMap don't recognize space in number and don't delete that

Hello

 

In tFileInputExcel, there is a cell which has a number : 1 543 982

This number was calculated with a formula in Excel : =SUB.TOTAL(7;AB3:AB32) and we read : 1 543 982 (Number) in in Excel

 

So, Talend considers 1 543 982 as a String and not a number.

I tried delete space but tMap doesn't recognize the space in this "String" : 1 543 982.

So, i tried with : 

StringHandling.EREPLACE(row1.Number," ","")  in tMap but it doesn't work.

Also : 

(!Relational.ISNULL(row1.Number))?row1.Number.replace(" ",""):row1.Number

It doesn't work at all.

 

Double.parse(row1.Number)

==> Error : Exception in component tMap_1 (Marge_NET)
java.lang.NumberFormatException: For input string: "1 346 417"

 

I also tried with tReplace and nothing.

 

I don't understand why it doesn't work...

 

Labels (3)
27 Replies
Anonymous
Not applicable
Author

Well, it works in the v7 and so, i again run with the file which i work above (Not the one that I made for you). It doesn't work.

 

I think that when I received the file, it was in format xlsb and i save the file in the format xlsx because Talend can't read the format xlsb. It maybe broke the file.

But i don't understand why this line doesn't work and the others lines work very well. 

Anonymous
Not applicable
Author

The numberformatexception is because (I'm guessing) of the comma. Your environment settings probably have the decimal separator set to ".". As such, a comma "," as the separator will cause this. It's a pretty common error to come across when you are converting from a String to a number and your system is not expecting (for example) French number formatting in English.

Anonymous
Not applicable
Author

The line does not work because you are trying to remove characters that you do not know of. The best way to work this out is to use a tool to identify the characters and then remove those. I think you may be right with your assumption about the conversion of an xlsb to xlsx. Unfortunately, I cannot help any more than this unless I can recreate the issue. Everything I have tried has worked. 

I don't believe this is a Talend issue though, it is just simple Java. As I said, I think this is a case of just not knowing the characters that have been added to the number.

Anonymous
Not applicable
Author

Thank you for your answers. I am going to put aside this line, I shall speak with my colleague when he will come back from his holidays. Maybe, he will know how to identify the characters and then remove those.

Anonymous
Not applicable
Author

Try this site http://www.babelstone.co.uk/Unicode/whatisit.html

Just copy and paste from your Excel document into this tool and it will tell you.

Anonymous
Not applicable
Author

I entried 1346416 and i have : 

U+0031 : DIGIT ONE
U+0020 : SPACE [SP]
U+0033 : DIGIT THREE
U+0034 : DIGIT FOUR
U+0036 : DIGIT SIX
U+0020 : SPACE [SP]
U+0034 : DIGIT FOUR
U+0031 : DIGIT ONE
U+0037 : DIGIT SEVEN
Anonymous
Not applicable
Author

If that is the case, something is broken. Do you have another machine to test your job on? 

Anonymous
Not applicable
Author

No, unfortunately, I have no other available machine but i am going to reflect to find another machin to test this job