Hi everyone I want to convert an specific Excel column to integer when it loads in double datatype. For that I am using a Java If (Table) but I am unable to write the code properly
I am doing these attempts
if ($${SCOLUMN TO INTEGER II}$$ = "Number (double)") {
return 0;
}
else {
return 1;
}
The other one
if ($${SCOLUMN TO INTEGER II}$$.equals(Number (double))) {
return 0;
}
else {
return 1;
}
Hi @mauuuuu5,
why so complicated? Can’t you just use a Double To Int node? If the column is there and a double, it will convert it. Otherwise it is ignored.
Kind regards
Alexander
but the final user does not want to deal or read any column datatype, just want to press run and see it converted.
And what is wrong with the Double To Int node then? The user does not have to configure anything. The node will simply cast any double column to integer. If only some should be cast, you can also use a wildcard or regex pattern in the second tab of the column selection configuration.
Kind regards
Alexander