Six Stars

How to use StringHandling.LEN() function for integer column?

Hi Talend Folks,

 

                I want know how to use StringHandling.LEN() function for integer column. I am facing error in below query. could please tell me?

 

StringHandling.LEN(row1.CARID)>2?0:1

  • Big Data
  • Data Integration
  • ESB
  • Exchange components
  • SDI
  • Talend Integration Cloud
1 ACCEPTED SOLUTION

Accepted Solutions
Six Stars

Re: How to use StringHandling.LEN() function for integer column?

Hi RAJESH_GJ,

Try to convert the integer value to string and use the length function.

Below is the function.

StringHandling.LEN(row1.newColumn.toString()) 

 

 

Thanks,

Bharath.

 

5 REPLIES
Highlighted
Ten Stars

Re: How to use StringHandling.LEN() function for integer column?

StringHandling functions are for strings. What exactly are you trying to do?
Six Stars

Re: How to use StringHandling.LEN() function for integer column?

Dear cterenzi,

 

THANK YOU FOR IMMEDIATE RESPONSE 

HOW TO FIND COLUMN VALUE LENGTH?

 

FOR EXAMPLE:

IF CARID Column VALUE LENGTH IS GREATER THAN 2 I NEED TO SET 0 ELSE I NEED TO SET 1 

 

LEN(ROW1.CARID)>2 ? 0 : 1

 

Eleven Stars TRF
Eleven Stars

Re: How to use StringHandling.LEN() function for integer column?

Asking for Integer length doesn't make sense.
If ROW1.CARID is Integer datatype use this:
ROW1.CARID > 99 ? 0 : 1
If it's > 99, the length is > 2, isn't it?

TRF
Six Stars

Re: How to use StringHandling.LEN() function for integer column?

Hi RAJESH_GJ,

Try to convert the integer value to string and use the length function.

Below is the function.

StringHandling.LEN(row1.newColumn.toString()) 

 

 

Thanks,

Bharath.

 

Eleven Stars TRF
Eleven Stars

Re: How to use StringHandling.LEN() function for integer column?

A little expensive just to know if an Integer is greater to 99.
Doesn't it?

TRF