<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic StringHandling.LEN(col1) return -1 when value of col1 is null in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/StringHandling-LEN-col1-return-1-when-value-of-col1-is-null/m-p/2344210#M111888</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone explain why StringHandling.LEN returns -1 in below scenario?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;StringHandling.LEN(col1) return -1 when value of col1 is null. &lt;/P&gt;</description>
    <pubDate>Fri, 21 May 2021 10:43:20 GMT</pubDate>
    <dc:creator>NarenS701</dc:creator>
    <dc:date>2021-05-21T10:43:20Z</dc:date>
    <item>
      <title>StringHandling.LEN(col1) return -1 when value of col1 is null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/StringHandling-LEN-col1-return-1-when-value-of-col1-is-null/m-p/2344210#M111888</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone explain why StringHandling.LEN returns -1 in below scenario?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;StringHandling.LEN(col1) return -1 when value of col1 is null. &lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 10:43:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/StringHandling-LEN-col1-return-1-when-value-of-col1-is-null/m-p/2344210#M111888</guid>
      <dc:creator>NarenS701</dc:creator>
      <dc:date>2021-05-21T10:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: StringHandling.LEN(col1) return -1 when value of col1 is null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/StringHandling-LEN-col1-return-1-when-value-of-col1-is-null/m-p/2344211#M111889</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;You can look into the source code of this function in Repository--&amp;gt;Code--&amp;gt;Routine--&amp;gt;System--&amp;gt;StringHandling. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;public static int LEN(String string) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return string == null ? -1 : string.length();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To avoid the value is -1 if it is null, you can set it to 0 with this expression on tMap.&lt;/P&gt;&lt;P&gt;row1.columnName==null?0:StringHandling.LEN(row1.column)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 10:58:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/StringHandling-LEN-col1-return-1-when-value-of-col1-is-null/m-p/2344211#M111889</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-21T10:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: StringHandling.LEN(col1) return -1 when value of col1 is null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/StringHandling-LEN-col1-return-1-when-value-of-col1-is-null/m-p/2344212#M111890</link>
      <description>&lt;P&gt;Thank you @Shicong Hong​&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 11:12:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/StringHandling-LEN-col1-return-1-when-value-of-col1-is-null/m-p/2344212#M111890</guid>
      <dc:creator>NarenS701</dc:creator>
      <dc:date>2021-05-21T11:12:05Z</dc:date>
    </item>
  </channel>
</rss>

