I'm trying to define a business rule to check if my input is a numeric value or not.
Here's my input:
I've applied the next rule in a tMap but unfortunetely it doesn't work (the output gives me zeros):
StringHandling.LEN(out5.Volumen_DM3) > 0 &&
In my tMap input this field is defined as a string and the output is an integer since I've established 1 for correct and 0 incorrect.
Could anyone help me with this rule?
Solved! Go to Solution.
This one works:
StringHandling.LEN(row1.volume) > 0 && row1.volume.matches("^[0-9,]+$") ? 1 : 0
Just add a comma into the brackets.
It works but I have still problems when the input value has a ".", for example: 1.503,67
Do you know what I would have to add in order to solve the problem?
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Part 2 of a series on Context Variables
Learn how to do cool things with Context Variables
Read about some useful Context Variable ideas