<?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 how to use below case statement in tmap in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/how-to-use-below-case-statement-in-tmap/m-p/2297128#M69731</link>
    <description>&lt;P&gt;Hi People,&lt;/P&gt;&lt;P&gt;Can somebody help me converting below case statement in tmap please.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;case when substr(naics_cd,1,2)='23' then 'Construction'&lt;BR /&gt;when substr(naics_cd,1,2)='11' then 'Agriculture'&lt;BR /&gt;when (substr(naics_cd,1,2) in ('31','32','33') and SUBSTR(NAICS_CD,1,4) not in('3366')) then 'Manufacturing'&lt;BR /&gt;when (substr(naics_cd,1,4) in('3366', '4872', '4883') or substr(naics_cd,1,3)='483') then 'Maritime'&lt;BR /&gt;else 'General Industry'&lt;BR /&gt;END as col&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Teja&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jan 2018 22:14:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-01-03T22:14:50Z</dc:date>
    <item>
      <title>how to use below case statement in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-use-below-case-statement-in-tmap/m-p/2297128#M69731</link>
      <description>&lt;P&gt;Hi People,&lt;/P&gt;&lt;P&gt;Can somebody help me converting below case statement in tmap please.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;case when substr(naics_cd,1,2)='23' then 'Construction'&lt;BR /&gt;when substr(naics_cd,1,2)='11' then 'Agriculture'&lt;BR /&gt;when (substr(naics_cd,1,2) in ('31','32','33') and SUBSTR(NAICS_CD,1,4) not in('3366')) then 'Manufacturing'&lt;BR /&gt;when (substr(naics_cd,1,4) in('3366', '4872', '4883') or substr(naics_cd,1,3)='483') then 'Maritime'&lt;BR /&gt;else 'General Industry'&lt;BR /&gt;END as col&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Teja&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2018 22:14:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-use-below-case-statement-in-tmap/m-p/2297128#M69731</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-03T22:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to use below case statement in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-use-below-case-statement-in-tmap/m-p/2297129#M69732</link>
      <description>&lt;P&gt;There are several ways to do this.&lt;/P&gt;
&lt;P&gt;1) You can write a routine which uses a Java switch statement (&lt;A href="https://docs.oracle.com/javase/tutorial/java/nutsandbolts/switch.html&amp;nbsp;" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.oracle.com/javase/tutorial/java/nutsandbolts/switch.html&amp;nbsp;&lt;/A&gt; and&amp;nbsp; &lt;A href="https://www.talendbyexample.com/talend-code-routines-reference.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.talendbyexample.com/talend-code-routines-reference.html&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;2) You can make use of tMap variables and test each of your cases per variable. For example, you could have 6 variables (&lt;SPAN&gt;Construction,&amp;nbsp;Agriculture,&amp;nbsp;Manufacturing,&amp;nbsp;Maritime,&amp;nbsp;General_Industry and Result&lt;/SPAN&gt;)and test your column values against each of them. Then use the Result variable to assess which variable value to use. An example of the variable code (without the substring Java since this can be Googled) would be.....&lt;/P&gt;
&lt;P&gt;Var.Construction&lt;/P&gt;
&lt;PRE&gt;row1.value.compareToIgnoreCase("23")==0 ? "Construction" : null&lt;/PRE&gt;
&lt;P&gt;Then the Result variable would hold something like below (assuming the other variables have been configured)...&lt;/P&gt;
&lt;PRE&gt;Var.Construction!=null ? Var.Construction : Var.Agriculture !=null ? Var.Agriculture : Var.Manufacturing!=null ? Var.Manufacturing : Var.Maritime!= null ? Var.Maritime : Var.General_Industry!=null ? Var.General_Industry : null&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;......there are other ways, but the above should help you&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 10:04:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-use-below-case-statement-in-tmap/m-p/2297129#M69732</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-04T10:04:15Z</dc:date>
    </item>
  </channel>
</rss>

