Converting long to integer

I’m trying to join 2 documents together using the joiner node using the same column found in both. But the second document has very long numbers and so is having an error when joining - “?_Row0” is Number (long) and does not comply with its supposed superclass Number (integer)"

How can I convert that column to an integer so that I can join both documents together?

I’d appreciate your help!

Dear @nightsky3

The safest option would be to convert the Integer to a Long. The reason why Long exists could be because the values are too high for the Integer type and converting it to an Integer could cause an overflow problem. The conversion can be done with the Table Manipulator node. After this, the join can be performed on the two Long columns.

In case it is safe to convert the Long to an Integer, this can be done with a Math Formula node; make sure to tick the “Convert to Int” box at the bottom. (unfortunately the Table Manipulator node has no option for converting a Long to an Integer)

Best
Aswin

1 Like

@nightsky3 - You can simply use a String Manipulation node to achieve the same. This node can be used to convert Long to Integer and Integer to Long. See the snapshot below. In the expression editor keep the required one only and replace “new column” with your column name.

Thanks!

3 Likes

Hi @omprakashjena, nice tip, very useful :smiley: i was not aware that the String Manipulation node could output anything else than strings…

You could also try out these settings of the Joiner Node:

1 Like

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