<?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 tMap if condition in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tMap-if-condition/m-p/2286430#M60052</link>
    <description>&lt;P&gt;Hi Everyone!&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am trying to do an if statement in the tMap component in Talend and it seems that I am just getting nulls back with my calculation. I am doing an exercise where I have to change the 1st number of the row to 19 or 20 based on the number. If the 1st number == 1 then replace it with 20 and if the 1st number == 0 replace it with 19. I will then convert the outputted number to a different date format. The data type is currently a string.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Example:&lt;/P&gt; 
&lt;P&gt;1040202 --&amp;gt; 20040202 --&amp;gt;&amp;nbsp;2004-02-02&lt;BR /&gt;0990930 --&amp;gt; 19990930 --&amp;gt;&amp;nbsp;1999-09-30&lt;BR /&gt;1141030 --&amp;gt; 20141030 --&amp;gt;&amp;nbsp;2014-10-30&lt;BR /&gt;1090613 --&amp;gt; 20090613 --&amp;gt;&amp;nbsp;2009-06-13&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;The Calculation I am currently using is to get to the second step in the proccess (replacing 0 to 19 and 1 to 20):&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;StringHandling.LEFT(row1.date,1)=="1"? StringHandling.EREPLACE(row1.date,StringHandling.LEFT(row1.date,1),"20"):&lt;BR /&gt;StringHandling.LEFT(row1.date,1)=="0"? StringHandling.EREPLACE(row1.date,StringHandling.LEFT(row1.date,1),"19"):null&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I split up the calculation to see where I am going wrong, but I am not sure where my errors are coming from. I separated the formulas and did:&lt;/P&gt; 
&lt;P&gt;SEE ATTACHED PHOTO&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Left1=&lt;/STRONG&gt;&amp;nbsp;StringHandling.LEFT(row1.date,1) &lt;STRONG&gt;-- WORKS&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Left1PartialCondition =&lt;/STRONG&gt; StringHandling.LEFT(row1.date,1)=="1"?"20":null&lt;STRONG&gt; -- DOESN'T WORK (receiving nulls for all)&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If someone can give me some input, that would be greatly appreciated as I did look all over community to try and solve this problem.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Thu, 06 Feb 2020 14:58:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-02-06T14:58:32Z</dc:date>
    <item>
      <title>tMap if condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMap-if-condition/m-p/2286430#M60052</link>
      <description>&lt;P&gt;Hi Everyone!&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am trying to do an if statement in the tMap component in Talend and it seems that I am just getting nulls back with my calculation. I am doing an exercise where I have to change the 1st number of the row to 19 or 20 based on the number. If the 1st number == 1 then replace it with 20 and if the 1st number == 0 replace it with 19. I will then convert the outputted number to a different date format. The data type is currently a string.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Example:&lt;/P&gt; 
&lt;P&gt;1040202 --&amp;gt; 20040202 --&amp;gt;&amp;nbsp;2004-02-02&lt;BR /&gt;0990930 --&amp;gt; 19990930 --&amp;gt;&amp;nbsp;1999-09-30&lt;BR /&gt;1141030 --&amp;gt; 20141030 --&amp;gt;&amp;nbsp;2014-10-30&lt;BR /&gt;1090613 --&amp;gt; 20090613 --&amp;gt;&amp;nbsp;2009-06-13&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;The Calculation I am currently using is to get to the second step in the proccess (replacing 0 to 19 and 1 to 20):&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;StringHandling.LEFT(row1.date,1)=="1"? StringHandling.EREPLACE(row1.date,StringHandling.LEFT(row1.date,1),"20"):&lt;BR /&gt;StringHandling.LEFT(row1.date,1)=="0"? StringHandling.EREPLACE(row1.date,StringHandling.LEFT(row1.date,1),"19"):null&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I split up the calculation to see where I am going wrong, but I am not sure where my errors are coming from. I separated the formulas and did:&lt;/P&gt; 
&lt;P&gt;SEE ATTACHED PHOTO&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Left1=&lt;/STRONG&gt;&amp;nbsp;StringHandling.LEFT(row1.date,1) &lt;STRONG&gt;-- WORKS&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Left1PartialCondition =&lt;/STRONG&gt; StringHandling.LEFT(row1.date,1)=="1"?"20":null&lt;STRONG&gt; -- DOESN'T WORK (receiving nulls for all)&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If someone can give me some input, that would be greatly appreciated as I did look all over community to try and solve this problem.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 14:58:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMap-if-condition/m-p/2286430#M60052</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-06T14:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: tMap if condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMap-if-condition/m-p/2286431#M60053</link>
      <description>&lt;P&gt;When you compare strings in Java, you need to use .equals(). So, your condition would be&amp;nbsp;&lt;SPAN&gt;StringHandling.LEFT(row1.date,1).equals("1").&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 16:22:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMap-if-condition/m-p/2286431#M60053</guid>
      <dc:creator>cmendels</dc:creator>
      <dc:date>2020-02-07T16:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: tMap if condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMap-if-condition/m-p/2286432#M60054</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thank you for your response! So,&amp;nbsp; I tried doing that in the formula and the 19 and 20 is repeating in the date and not just for the 1st left character.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_14.png" style="width: 237px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M92S.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141442i390BE730F5D33574/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M92S.png" alt="0683p000009M92S.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;StringHandling.LEFT(row1.date,1).equals("1")? StringHandling.EREPLACE(row1.date,StringHandling.LEFT(row1.date,1),"20"):&lt;BR /&gt;StringHandling.LEFT(row1.date,1).equals("0")? StringHandling.EREPLACE(row1.date,StringHandling.LEFT(row1.date,1),"19"):row1.date&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 16:48:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMap-if-condition/m-p/2286432#M60054</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-07T16:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: tMap if condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMap-if-condition/m-p/2286433#M60055</link>
      <description>&lt;P&gt;EREPLACE replaces all instances of the string, so you might want to do "20"+row1.date1.substring(1).&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 17:08:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMap-if-condition/m-p/2286433#M60055</guid>
      <dc:creator>cmendels</dc:creator>
      <dc:date>2020-02-07T17:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: tMap if condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tMap-if-condition/m-p/2286434#M60056</link>
      <description>Thank you so much!! Got it to work.</description>
      <pubDate>Fri, 07 Feb 2020 18:06:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tMap-if-condition/m-p/2286434#M60056</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-07T18:06:16Z</dc:date>
    </item>
  </channel>
</rss>

