<?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: tmap error converting null to Double in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351491#M118129</link>
    <description>123</description>
    <pubDate>Wed, 21 Dec 2011 14:44:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-12-21T14:44:15Z</dc:date>
    <item>
      <title>tmap error converting null to Double</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351486#M118124</link>
      <description>I am reading an Excel file and have the following values in a field .... null, "1234.00", "1234.00-". I am putting the "-" in front of the field and converting it to a Double but when it finds a "null", I get an exception error. How do I handle the "null" value? 
&lt;BR /&gt;Exception Error: 
&lt;BR /&gt;Double.parseDouble(Unknown Source) 
&lt;BR /&gt;tMap Code into a Var: 
&lt;BR /&gt;StringHandling.INDEX(row1.Field,"-")&amp;gt;0?Double.parseDouble("-"+StringHandling.TRIM(StringHandling.EREPLACE(row1.Field,"-"," "))) 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACJ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133049iD780B7DE0116E4D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACJ.png" alt="0683p000009MACJ.png" /&gt;&lt;/span&gt;ouble.parseDouble(StringHandling.TRIM(row1.Field)) 
&lt;BR /&gt; 
&lt;BR /&gt;Thanks</description>
      <pubDate>Sat, 16 Nov 2024 12:29:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351486#M118124</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: tmap error converting null to Double</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351487#M118125</link>
      <description>Hi,
&lt;BR /&gt;you a should a test to check if the variable is null
&lt;BR /&gt;
&lt;PRE&gt;Relational.ISNULL(row1.Field) ? null : (StringHandling.INDEX(row1.Field,"-")&amp;gt;0?Double.parseDouble("-"+StringHandling.TRIM(StringHandling.EREPLACE(row1.Field,"-"," "))):Double.parseDouble(StringHandling.TRIM(row1.Field))  )&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Dec 2011 14:14:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351487#M118125</guid>
      <dc:creator>ytuzet</dc:creator>
      <dc:date>2011-12-21T14:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: tmap error converting null to Double</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351488#M118126</link>
      <description>Now the exception message has changed to 
&lt;BR /&gt;Exception in component tMap_1 
&lt;BR /&gt;java.lang.NullPointerException 
&lt;BR /&gt;on the Debug Trace, the field shows .... null from an Excel spreadsheet. I even tried comparing to the field to "null" in case it came in as a string. 
&lt;BR /&gt; 
&lt;BR /&gt;Relational.ISNULL(row1.ESCMP__1)|| (row1.ESCMP__1=="null")? null : (StringHandling.INDEX(row1.ESCMP__1,"-")&amp;gt;0?Double.parseDouble("-"+StringHandling.TRIM(StringHandling.EREPLACE(row1.ESCMP__1,"-"," "))) 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACJ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133049iD780B7DE0116E4D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACJ.png" alt="0683p000009MACJ.png" /&gt;&lt;/span&gt;ouble.parseDouble(StringHandling.TRIM(row1.ESCMP__1)))</description>
      <pubDate>Wed, 21 Dec 2011 14:28:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351488#M118126</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-21T14:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: tmap error converting null to Double</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351489#M118127</link>
      <description>you can try that:
&lt;BR /&gt;
&lt;PRE&gt;Relational.ISNULL(row1.ESCMP__1)|| (StringHandling.TRIM(row1.ESCMP__1)=="")? null : (StringHandling.INDEX(row1.ESCMP__1,"-")&amp;gt;0?Double.parseDouble("-"+StringHandling.TRIM(StringHandling.EREPLACE(row1.ESCMP__1,"-"," "))):Double.parseDouble(StringHandling.TRIM(row1.ESCMP__1)))&lt;/PRE&gt;
&lt;BR /&gt;maybe your field is not nullable
&lt;BR /&gt;can you put 0 instead of null
&lt;BR /&gt;
&lt;PRE&gt;Relational.ISNULL(row1.ESCMP__1) ? new Double(0) : (StringHandling.INDEX(row1.ESCMP__1,"-")&amp;gt;0?Double.parseDouble("-"+StringHandling.TRIM(StringHandling.EREPLACE(row1.ESCMP__1,"-"," "))):Double.parseDouble(StringHandling.TRIM(row1.ESCMP__1)))&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Dec 2011 14:33:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351489#M118127</guid>
      <dc:creator>ytuzet</dc:creator>
      <dc:date>2011-12-21T14:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: tmap error converting null to Double</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351490#M118128</link>
      <description>that worked, thanks very much, been working on it for more than I want to admit !</description>
      <pubDate>Wed, 21 Dec 2011 14:38:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351490#M118128</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-21T14:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: tmap error converting null to Double</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351491#M118129</link>
      <description>123</description>
      <pubDate>Wed, 21 Dec 2011 14:44:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351491#M118129</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-21T14:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: tmap error converting null to Double</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351492#M118130</link>
      <description>You're welcome ! it often goes like that ...&lt;BR /&gt;Which solution worked?</description>
      <pubDate>Wed, 21 Dec 2011 14:47:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351492#M118130</guid>
      <dc:creator>ytuzet</dc:creator>
      <dc:date>2011-12-21T14:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: tmap error converting null to Double</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351493#M118131</link>
      <description>Putting in the new Double(0) instead of null on the true test. 
&lt;BR /&gt;Relational.ISNULL(row1.field)|| (row1.field=="null")? new Double(0): (StringHandling.INDEX(row1.field,"-")&amp;gt;0?Double.parseDouble("-"+StringHandling.TRIM(StringHandling.EREPLACE(row1.field,"-"," "))) 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACJ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133049iD780B7DE0116E4D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACJ.png" alt="0683p000009MACJ.png" /&gt;&lt;/span&gt;ouble.parseDouble(StringHandling.TRIM(row1.field))) 
&lt;BR /&gt; 
&lt;BR /&gt;value result 
&lt;BR /&gt;null 0 
&lt;BR /&gt;"1234.56" 1234.56 
&lt;BR /&gt;"1234.56-" -1234.56</description>
      <pubDate>Wed, 21 Dec 2011 15:41:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tmap-error-converting-null-to-Double/m-p/2351493#M118131</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-21T15:41:58Z</dc:date>
    </item>
  </channel>
</rss>

