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

Highlighted
Eight Stars RAJ
Eight 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

Thanks
RAJ

Accepted Solutions
Eight 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.

 


All Replies
Ten Stars

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

StringHandling functions are for strings. What exactly are you trying to do?
Eight Stars RAJ
Eight 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

 

Thanks
RAJ
Fifteen Stars TRF
Fifteen 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
Eight 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.

 

Fifteen Stars TRF
Fifteen 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

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now