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

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

 

View solution in original post


All 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?
Highlighted
Eight Stars
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
Highlighted
Sixteen Stars
Sixteen 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
Highlighted
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.

 

View solution in original post

Highlighted
Sixteen Stars
Sixteen 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

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

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

How to Modernize Your Cloud Platform for Big Data Analytics With Talend and Micr...

Learn how<SPAN>to modernize your Cloud Platform for Big Data Analytics with Talend and Microsoft Azure</SPAN>

Read