<?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.RIGHT doesn't work as it should in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/StringHandling-RIGHT-doesn-t-work-as-it-should/m-p/2364287#M128057</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;My input is a row with some Line Feed and Carriage Return.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Input value :&lt;/STRONG&gt; "RPT-GL2-098&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;surname.name"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;My first &lt;SPAN class="short_text"&gt;&lt;SPAN class=""&gt;treatment&lt;/SPAN&gt;&lt;/SPAN&gt; replace all the LF and CR by space&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;row1.BRANCH_CODE.replaceAll("(?:\\n|\\r)", " ") as Var.NAME_1&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Output :&lt;/STRONG&gt; "RPT-GL2-098&amp;nbsp;&amp;nbsp; surname.name"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;My second treatment replace all space by a '#' (it can be another special char, just used to be detected by INDEX)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;Var.NAME_1.replaceAll("\\s{2,}", "#") as Var.NAME_2&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Output :&lt;/STRONG&gt; "RPT-GL2-098#surname.name"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In my final treatment, I want to extract "surname.name" by taking all the string at the right of the char '#':&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;StringHandling.RIGHT(Var.NAME_2,StringHandling.INDEX(Var.NAME_2,"#")) &lt;/PRE&gt; 
&lt;P&gt;&lt;STRONG&gt;Output I want :&lt;/STRONG&gt; "surname.name"&lt;/P&gt; 
&lt;P&gt;It work for one case, but it truncate in other case (There's 11 char a the LEFT of the # for my first row and my output is 11 char max).&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Output I have :&lt;/STRONG&gt; "surname.name" for the first occurence (11char)&lt;/P&gt; 
&lt;P&gt;On the others outputs even if there's more or less than 11 char, I have a 11 char string.&lt;/P&gt; 
&lt;P&gt;When it's less than 11 char I have something like "GL2-098#.name"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I don't understand what's wrong. RIGHT is supposed to take the n char after the INDEX, but he take only 11 (and my INDEX = 11 on my first row)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Maybe it's not dynamic, how can I solve this problem ?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jul 2018 14:15:02 GMT</pubDate>
    <dc:creator>Mayot</dc:creator>
    <dc:date>2018-07-20T14:15:02Z</dc:date>
    <item>
      <title>StringHandling.RIGHT doesn't work as it should</title>
      <link>https://community.qlik.com/t5/Talend-Studio/StringHandling-RIGHT-doesn-t-work-as-it-should/m-p/2364287#M128057</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;My input is a row with some Line Feed and Carriage Return.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Input value :&lt;/STRONG&gt; "RPT-GL2-098&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;surname.name"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;My first &lt;SPAN class="short_text"&gt;&lt;SPAN class=""&gt;treatment&lt;/SPAN&gt;&lt;/SPAN&gt; replace all the LF and CR by space&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;row1.BRANCH_CODE.replaceAll("(?:\\n|\\r)", " ") as Var.NAME_1&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Output :&lt;/STRONG&gt; "RPT-GL2-098&amp;nbsp;&amp;nbsp; surname.name"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;My second treatment replace all space by a '#' (it can be another special char, just used to be detected by INDEX)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;Var.NAME_1.replaceAll("\\s{2,}", "#") as Var.NAME_2&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Output :&lt;/STRONG&gt; "RPT-GL2-098#surname.name"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In my final treatment, I want to extract "surname.name" by taking all the string at the right of the char '#':&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;StringHandling.RIGHT(Var.NAME_2,StringHandling.INDEX(Var.NAME_2,"#")) &lt;/PRE&gt; 
&lt;P&gt;&lt;STRONG&gt;Output I want :&lt;/STRONG&gt; "surname.name"&lt;/P&gt; 
&lt;P&gt;It work for one case, but it truncate in other case (There's 11 char a the LEFT of the # for my first row and my output is 11 char max).&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Output I have :&lt;/STRONG&gt; "surname.name" for the first occurence (11char)&lt;/P&gt; 
&lt;P&gt;On the others outputs even if there's more or less than 11 char, I have a 11 char string.&lt;/P&gt; 
&lt;P&gt;When it's less than 11 char I have something like "GL2-098#.name"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I don't understand what's wrong. RIGHT is supposed to take the n char after the INDEX, but he take only 11 (and my INDEX = 11 on my first row)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Maybe it's not dynamic, how can I solve this problem ?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jul 2018 14:15:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/StringHandling-RIGHT-doesn-t-work-as-it-should/m-p/2364287#M128057</guid>
      <dc:creator>Mayot</dc:creator>
      <dc:date>2018-07-20T14:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: StringHandling.RIGHT doesn't work as it should</title>
      <link>https://community.qlik.com/t5/Talend-Studio/StringHandling-RIGHT-doesn-t-work-as-it-should/m-p/2364288#M128058</link>
      <description>&lt;P&gt;Ok my bad I'm tired.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So StringHandling.RIGHT(String, n) is taking all the n char from the END RIGHT of the string and not all the char at the RIGHT of the "index" (n).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So I solve my case&lt;/P&gt; 
&lt;P&gt;3 more treatments to calculate how many char I need to extract&lt;/P&gt; 
&lt;PRE&gt;StringHandling.LEN(Var.NAME_2) as Var.LENGTH&lt;/PRE&gt; 
&lt;PRE&gt;StringHandling.INDEX(Var.NAME_2,"#") as Var.INDEX&lt;/PRE&gt; 
&lt;PRE&gt;Var.LENGTH -  Var.INDEX -1 as Var.LENGTH_MIN_INDEX&lt;/PRE&gt; 
&lt;P&gt;And my final treatment :&lt;/P&gt; 
&lt;PRE&gt;StringHandling.RIGHT(Var.NAME_2,Var.LENGTH_MIN_INDEX)   &lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jul 2018 14:29:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/StringHandling-RIGHT-doesn-t-work-as-it-should/m-p/2364288#M128058</guid>
      <dc:creator>Mayot</dc:creator>
      <dc:date>2018-07-20T14:29:44Z</dc:date>
    </item>
  </channel>
</rss>

