<?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 Re: How to only do a decode if the field is not null in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-only-do-a-decode-if-the-field-is-not-null/m-p/2221391#M15420</link>
    <description>&lt;P&gt;You can just reverse the&amp;nbsp;comparisons if you want row1.Status as the default value:&lt;/P&gt; 
&lt;PRE&gt;"GULF".equals(row1.PFR_REGION) ? "3" :
  "SF".equals(row1.PFR_REGION) ? "2" :
      "QUEBEC".equals(row1.PFR_REGION) ? "6" : row1.STATUS&lt;/PRE&gt; 
&lt;P&gt;Else, if you want an other default value, change the expression like this:&lt;/P&gt; 
&lt;PRE&gt;row1.PFR_REGION == null ? "YOUR DEFAULT VALUE" :
    "GULF".equals(row1.PFR_REGION) ? "3" :
        "SF".equals(row1.PFR_REGION) ? "2" :
            "QUEBEC".equals(row1.PFR_REGION) ? "6" : row1.STATUS&lt;/PRE&gt;</description>
    <pubDate>Wed, 26 Sep 2018 18:26:30 GMT</pubDate>
    <dc:creator>TRF</dc:creator>
    <dc:date>2018-09-26T18:26:30Z</dc:date>
    <item>
      <title>How to only do a decode if the field is not null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-only-do-a-decode-if-the-field-is-not-null/m-p/2221390#M15419</link>
      <description>&lt;P&gt;Hi I am currently using the code below for a decode but getting a null pointer when the value is null. Can someone let me know how I could check to see if the column is null before I do the decode. Below is my code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If not null then do below&lt;/P&gt;
&lt;P&gt;(row1.PFR_REGION.equals("GULF"))?"3": (row1.PFR_REGION.equals("SF"))?"2": (row1.PFR_REGION.equals("QUEBEC"))?"6":row1.STATUS&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 18:04:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-only-do-a-decode-if-the-field-is-not-null/m-p/2221390#M15419</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-26T18:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to only do a decode if the field is not null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-only-do-a-decode-if-the-field-is-not-null/m-p/2221391#M15420</link>
      <description>&lt;P&gt;You can just reverse the&amp;nbsp;comparisons if you want row1.Status as the default value:&lt;/P&gt; 
&lt;PRE&gt;"GULF".equals(row1.PFR_REGION) ? "3" :
  "SF".equals(row1.PFR_REGION) ? "2" :
      "QUEBEC".equals(row1.PFR_REGION) ? "6" : row1.STATUS&lt;/PRE&gt; 
&lt;P&gt;Else, if you want an other default value, change the expression like this:&lt;/P&gt; 
&lt;PRE&gt;row1.PFR_REGION == null ? "YOUR DEFAULT VALUE" :
    "GULF".equals(row1.PFR_REGION) ? "3" :
        "SF".equals(row1.PFR_REGION) ? "2" :
            "QUEBEC".equals(row1.PFR_REGION) ? "6" : row1.STATUS&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Sep 2018 18:26:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-only-do-a-decode-if-the-field-is-not-null/m-p/2221391#M15420</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-09-26T18:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to only do a decode if the field is not null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-only-do-a-decode-if-the-field-is-not-null/m-p/2221392#M15421</link>
      <description>&lt;P&gt;Thanks very much it works!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 12:55:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-only-do-a-decode-if-the-field-is-not-null/m-p/2221392#M15421</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-27T12:55:25Z</dc:date>
    </item>
  </channel>
</rss>

