<?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: Error converting string to bigdecimal on tMap in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Error-converting-string-to-bigdecimal-on-tMap/m-p/2298381#M70859</link>
    <description>Thanks ThWabi!</description>
    <pubDate>Tue, 06 Mar 2018 08:29:03 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-03-06T08:29:03Z</dc:date>
    <item>
      <title>Error converting string to bigdecimal on tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Error-converting-string-to-bigdecimal-on-tMap/m-p/2298377#M70855</link>
      <description>&lt;P&gt;Good Afternoon!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just want to ask help from you guys, I'm trying to transfer data from delimited file to MySQL db. 3 of my columns has to be decimal so I tried using new BigDecimal(row.column) but I'm having error when I'm running the job. Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 05:35:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Error-converting-string-to-bigdecimal-on-tMap/m-p/2298377#M70855</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-02T05:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error converting string to bigdecimal on tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Error-converting-string-to-bigdecimal-on-tMap/m-p/2298378#M70856</link>
      <description>&lt;P&gt;This question may have been overlooked as it probably is better suited to the "Design and Development" section.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;It looks like your issues are caused by your number (I assume it is returned as a String from the file)&amp;nbsp;being in a format that could not be converted. If a String representation of a number is empty ("") or has an extra space (" 34.8") or even has thousand separators ("10,000.00"), this error will be thrown. The first thing to try is to retrieve your data from the file in correct format. You should be able to adjust your schema for the file to set what it picks up as a BigDecimal. If this is not liked, then your data is in a bad format in the file. You need to figure out what is wrong in the file and then try to correct it before you convert it.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If it is a case of an extra space in the number (either side, like " 0.12" or "0.12 ") you can just add a trim to the column (row1.value.trim()).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If it is that there is a rogue comma (thousand separator in the UK), you can use a find and replace (row1.value.number.replaceAll(",", "")).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;You will also need to check for null. You cannot convert null to a BigDecimal. So something like this....&lt;/P&gt; 
&lt;P&gt;row1.value!=null&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;But, a much better way of doing this (to cover most scenarios) would be to use the following code....&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;row1.value!=null ? new BigDecimal(row1.value.replaceAll("[^\\d.]", "")) : null&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;This checks for null and if it is not null, removes all bad characters and converts to a BigDecimal. If it is null, it returns null.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 10:02:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Error-converting-string-to-bigdecimal-on-tMap/m-p/2298378#M70856</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-02T10:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Error converting string to bigdecimal on tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Error-converting-string-to-bigdecimal-on-tMap/m-p/2298379#M70857</link>
      <description>&lt;P&gt;Hi pauldcop,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;one of the input strings in row1.Value or row1.BasisValue or row1.Amount does not have the correct format to be converted to a BigDecimal. Please use this page&amp;nbsp;&lt;A title="BigDecimal Constructor String" href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#BigDecimal(java.lang.String)" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#BigDecimal(java.lang.String)&lt;/A&gt;&amp;nbsp;(for example) as a reference of what an input string has to look like to be convertable to a BigDecimal value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thomas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 10:02:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Error-converting-string-to-bigdecimal-on-tMap/m-p/2298379#M70857</guid>
      <dc:creator>ThWabi</dc:creator>
      <dc:date>2018-03-02T10:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Error converting string to bigdecimal on tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Error-converting-string-to-bigdecimal-on-tMap/m-p/2298380#M70858</link>
      <description>&lt;P&gt;Thanks rhall_2_0!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 08:28:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Error-converting-string-to-bigdecimal-on-tMap/m-p/2298380#M70858</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-06T08:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Error converting string to bigdecimal on tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Error-converting-string-to-bigdecimal-on-tMap/m-p/2298381#M70859</link>
      <description>Thanks ThWabi!</description>
      <pubDate>Tue, 06 Mar 2018 08:29:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Error-converting-string-to-bigdecimal-on-tMap/m-p/2298381#M70859</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-06T08:29:03Z</dc:date>
    </item>
  </channel>
</rss>

