String to Number

Hello together,

I am converting a string column in a data set into number type.
I am using string to Number node. My data contains “#” in the column.
For example,

Year
2019
2014
'#
2018
'#

Node does not count # as a number which is correct. The node fails to execute, how do I solve this?

Best Regards
Yuvraj

Hi Yuvraj,
which message do you see in the console when the node fails?

hello @toscanomatheus
error message is

WARN String To Number 0:100 Values in 57106 cells could not be parsed, first error: ‘#’ (RowKey: Row0, Position: 13)

Hello @Yuvraj,

that is not error but a warning message and node should be able to execute just fine. By design every value that can not be parsed as number is replaced with missing values. Can you check output of String to Number node after execution?

Br,
Ivan

Hello @ipazin,

thank you for response. Actually yes, the workflow did function well but the thing is string to number node deleted the entries with # . So when I take the data out from the KNIME, I get blank Space

Hi @Yuvraj,

and you want # sign when you export your data? Why is that if I may ask? And where do you export your data/which node do you use? Number type column in KNIME cannot have # sign.

Br,
Ivan

Hi @Yuvraj,

I’d go down the route of splitting your year using regex, this way you can cleanly convert the first output to numbers and do as you wish with the rest -

Untitled

I hope this helps!

Matt

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.