<?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: Int column having Null values in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368644#M131885</link>
    <description>&lt;P&gt;in that case, your code also returns incorrect data like if we pass decimal place double/float value will get null only.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: if we pass 1.9 then it returns&amp;nbsp;numberformatexception&amp;nbsp;and our routine will pass null&amp;nbsp;to the output which is also not correct as per my understanding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jul 2018 07:03:57 GMT</pubDate>
    <dc:creator>aashish_21nov</dc:creator>
    <dc:date>2018-07-26T07:03:57Z</dc:date>
    <item>
      <title>Int column having Null values</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368638#M131879</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have a problem with Null values present in my Integer column.&lt;/P&gt; 
&lt;P&gt;FLow :&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Input(.txt )---&amp;gt;Tmap---&amp;gt;Snowflake ouput&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Tmap : using the variable&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;row5.Column28==null||row5.Column28.equals("")?null:new Integer(row5.Column28)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;But giving me an error :&lt;/P&gt; 
&lt;P&gt;NumberFormatException: For input string: "NULL".&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Could you please let me know what am I doing wrong ?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;TIA&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 19:35:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368638#M131879</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-24T19:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Int column having Null values</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368639#M131880</link>
      <description>&lt;P&gt;&lt;SPAN&gt;row5.Column28 is a String of the value "NULL". This would meet your criteria of it not being null and it not being equal to an empty String. You need to check if your String is numeric. There is no Java function for this, but you can create one. Here is an example you could use (set it up in a routine)....&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;public static boolean isNumeric(String strNum) {
    boolean ret = true;
    try {

        Integer.parseInt(strNum);

    }catch (NumberFormatException e) {
        ret = false;
    }
    return ret;
}&lt;/PRE&gt; 
&lt;P&gt;&lt;SPAN&gt;Assuming this were to be added to a routine called MyUtils, your code would change to....&lt;/SPAN&gt;&lt;/P&gt; 
&lt;PRE&gt;routines.MyUtils.isNumeric(row5.Column28) ? new Integer(row5.Column28) : null&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jul 2018 21:36:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368639#M131880</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-24T21:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Int column having Null values</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368640#M131881</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LOaOAAW"&gt;@nbhandari&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can do so without any help of routine as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;while reading input.txt make column28 datatype change to String type. And in tmap write below code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;row5.Column28.equalsIgnoreCase("NULL") ? null : Integer.parseInt(&lt;SPAN&gt;row5.Column28)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 10:30:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368640#M131881</guid>
      <dc:creator>aashish_21nov</dc:creator>
      <dc:date>2018-07-25T10:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Int column having Null values</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368641#M131882</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;HR /&gt; 
 &lt;A href="https://community.qlik.com/s/profile/0053p000007LOUUAA4"&gt;@aashish&lt;/A&gt;&amp;nbsp;wrote: 
 &lt;BR /&gt; 
 &lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LOaOAAW"&gt;@nbhandari&lt;/A&gt;,&lt;/P&gt; 
 &lt;P&gt;&amp;nbsp;&lt;/P&gt; 
 &lt;P&gt;you can do so with any help of routine as well.&lt;/P&gt; 
 &lt;P&gt;&amp;nbsp;&lt;/P&gt; 
 &lt;P&gt;while reading input.txt make column28 datatype change to String type. And in tmap write below code:&lt;/P&gt; 
 &lt;P&gt;&amp;nbsp;&lt;/P&gt; 
 &lt;P&gt;row5.Column28.equalsIgnoreCase("NULL") ? null : Integer.parseInt(&lt;SPAN&gt;row5.Column28)&lt;/SPAN&gt;&lt;/P&gt; 
 &lt;HR /&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;P&gt;Your code will fall over if Column28 is null or if it is an empty String or if it is any String that is not "NULL"&amp;nbsp;or not a numeric String. The reason I gave the answer I did is because it covers all bases.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 11:30:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368641#M131882</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-25T11:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Int column having Null values</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368642#M131883</link>
      <description>&lt;P&gt;dear&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt; we can check all this thing in tmap as well:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Relational.ISNULL(column_name) || column_name.isEmpty() || column_name.equalsIgnoreCase("NULL") : null : column_name&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 12:27:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368642#M131883</guid>
      <dc:creator>aashish_21nov</dc:creator>
      <dc:date>2018-07-25T12:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Int column having Null values</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368643#M131884</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Integer.parseInt(&lt;/SPAN&gt;&lt;SPAN&gt;row5.Column28) will return a&amp;nbsp;NumberFormatException which will kill the job if the String passed to it is not a number. There was a reason I supplied the answer that I gave.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 13:18:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368643#M131884</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-25T13:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Int column having Null values</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368644#M131885</link>
      <description>&lt;P&gt;in that case, your code also returns incorrect data like if we pass decimal place double/float value will get null only.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: if we pass 1.9 then it returns&amp;nbsp;numberformatexception&amp;nbsp;and our routine will pass null&amp;nbsp;to the output which is also not correct as per my understanding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2018 07:03:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368644#M131885</guid>
      <dc:creator>aashish_21nov</dc:creator>
      <dc:date>2018-07-26T07:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Int column having Null values</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368645#M131886</link>
      <description>&lt;P&gt;Look at the original code. They want an Integer. They are parsing an Integer. As such, the code is fine. I can only work to the requirements I am given. It is correct that it will return false for a decimal. However, if they want to accept Integers and Doubles (the original code will have to change parse an Integer or a Double), they can switch the method around to use Double.parseDouble().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2018 09:16:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Int-column-having-Null-values/m-p/2368645#M131886</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-26T09:16:32Z</dc:date>
    </item>
  </channel>
</rss>

