<?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: [resolved] Exception in component tMap_1 java.text.ParseException Unparseable num in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Exception-in-component-tMap-1-java-text-ParseException/m-p/2374254#M136880</link>
    <description>Dear All
&lt;BR /&gt;the following solution worked for me:
&lt;BR /&gt;row1.Column0.equals("") ? null : java.text.NumberFormat.getNumberInstance(java.util.Locale.US).parse(row1.Column0.trim()).doubleValue() &amp;nbsp;
&lt;BR /&gt;Thank you!
&lt;BR /&gt;Best Regards,
&lt;BR /&gt;Robert</description>
    <pubDate>Thu, 14 Aug 2014 12:06:46 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-08-14T12:06:46Z</dc:date>
    <item>
      <title>[resolved] Exception in component tMap_1 java.text.ParseException Unparseable num</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Exception-in-component-tMap-1-java-text-ParseException/m-p/2374249#M136875</link>
      <description>Dear All, 
&lt;BR /&gt;I try to import data from flat file (csv) to Oracle 10g Database with talend ETL tool (Version 5.0 ) 
&lt;BR /&gt;In the file that we recieved from the department we have American number format: 1.000,25 
&lt;BR /&gt;I use this expression in the tMap component to convert US format to German number format accrdoing to the database NLS parameters: 
&lt;BR /&gt; 
&lt;B&gt;java.text.NumberFormat.getNumberInstance(java.util.Locale.US).parse(row1.SALES_VALUE_LOC).doubleValue()&lt;/B&gt;&amp;nbsp;&amp;nbsp; 
&lt;BR /&gt;It is working fine but we have a problem with empty fields. 
&lt;BR /&gt;The problem is occurs if the "SALES_VALUE_LOC" does not hold any value. Then java can not handle the empty field and interrupts the data import. 
&lt;BR /&gt; 
&lt;FONT color="#ff3333"&gt;&lt;B&gt;Exception in component tMap_1&lt;BR /&gt;java.text.ParseException: Unparseable number: ""&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at java.text.NumberFormat.parse(Unknown Source)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at dwhggbnew.string_staging_sales_cn1_a_0_1.String_Staging_Sales_CN1_a.tFileInputDelimited_1Process(String_Staging_Sales_CN1_a.java:1743)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at dwhggbnew.string_staging_sales_cn1_a_0_1.String_Staging_Sales_CN1_a.tOracleRow_1Process(String_Staging_Sales_CN1_a.java:642)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at dwhggbnew.string_staging_sales_cn1_a_0_1.String_Staging_Sales_CN1_a.tFileList_1Process(String_Staging_Sales_CN1_a.java:498)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at dwhggbnew.string_staging_sales_cn1_a_0_1.String_Staging_Sales_CN1_a.runJobInTOS(String_Staging_Sales_CN1_a.java:3034)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;at dwhggbnew.string_staging_sales_cn1_a_0_1.String_Staging_Sales_CN1_a.main(String_Staging_Sales_CN1_a.java:2902)&lt;BR /&gt; disconnected&lt;/B&gt;&lt;/FONT&gt; 
&lt;BR /&gt;Question: 
&lt;BR /&gt;Frequently in the file the number fields are null. How can I handle the null value with the method parse() in this scase. 
&lt;BR /&gt;I need something like: 
&lt;BR /&gt;if ( 
&lt;B&gt;row1.SALES_VALUE_LOC !=&lt;/B&gt; null) 
&lt;BR /&gt;{ 
&lt;B&gt;java.text.NumberFormat.getNumberInstance(java.util.Locale.US).parse(row1.SALES_VALUE_LOC).doubleValue();&lt;/B&gt; 
&lt;BR /&gt;} 
&lt;BR /&gt;else{ 
&lt;BR /&gt; 
&lt;B&gt;row1.SALES_VALUE_LOC;&lt;/B&gt; 
&lt;BR /&gt;} 
&lt;BR /&gt;But this expression does not work if I inserted it in the tMap compnent. 
&lt;BR /&gt;Any support is appreciated. 
&lt;BR /&gt;Thank you! 
&lt;BR /&gt;Best Regards, 
&lt;BR /&gt;Robert</description>
      <pubDate>Fri, 01 Aug 2014 09:29:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Exception-in-component-tMap-1-java-text-ParseException/m-p/2374249#M136875</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-01T09:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Exception in component tMap_1 java.text.ParseException Unparseable num</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Exception-in-component-tMap-1-java-text-ParseException/m-p/2374250#M136876</link>
      <description>Hi Robert,&lt;BR /&gt;There is a function Relational.NULL(your.value), have you tested this...&lt;BR /&gt;Relational.NULL(your.value)?some dummy value:your.value&lt;BR /&gt;Similar logic you can implement for empty condition as well.&lt;BR /&gt;Try this.&lt;BR /&gt;Vaibhav</description>
      <pubDate>Fri, 01 Aug 2014 09:37:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Exception-in-component-tMap-1-java-text-ParseException/m-p/2374250#M136876</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-01T09:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Exception in component tMap_1 java.text.ParseException Unparseable num</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Exception-in-component-tMap-1-java-text-ParseException/m-p/2374251#M136877</link>
      <description>you can use same expression in tMAP like below. 
&lt;BR /&gt;&amp;nbsp; 
&lt;BR /&gt; 
&lt;PRE&gt;row1.SALES_VALUE_LOC != null &amp;amp;&amp;amp;&amp;nbsp; row1.SALES_VALUE_LOC !="" ? java.text.NumberFormat.getNumberInstance(java.util.Locale.US).parse(row1.SALES_VALUE_LOC).doubleValue(): row1.SALES_VALUE_LOC&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Aug 2014 09:57:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Exception-in-component-tMap-1-java-text-ParseException/m-p/2374251#M136877</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-01T09:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Exception in component tMap_1 java.text.ParseException Unparseable num</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Exception-in-component-tMap-1-java-text-ParseException/m-p/2374252#M136878</link>
      <description>Hi Umeshrakhe, 
&lt;BR /&gt;I would go with your solution my expression is: 
&lt;BR /&gt;row1.SALES_QTY != null ||&amp;nbsp; row1.SALES_QTY !="" ? java.text.NumberFormat.getNumberInstance(java.util.Locale.GERMAN).parse(row1.SALES_QTY).doubleValue(): null 
&lt;BR /&gt;I used "or"&amp;nbsp; --&amp;gt;&amp;nbsp; || operator and finally in would return null. 
&lt;BR /&gt;But still geting the error if I have empty field in the csv file. 
&lt;BR /&gt;FYI I convert string to double see my screen shots. 
&lt;BR /&gt;&amp;nbsp; 
&lt;BR /&gt;Exception in component tMap_1 
&lt;BR /&gt;java.text.ParseException: Unparseable number: "" 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at java.text.NumberFormat.parse(Unknown Source) 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at dwhggbnew.copy_of_string_staging_sales_cn1_a_0_1.Copy_of_String_Staging_Sales_CN1_a.tFileInputDelimited_1Process(Copy_of_String_Staging_Sales_CN1_a.java:1744) 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at dwhggbnew.copy_of_string_staging_sales_cn1_a_0_1.Copy_of_String_Staging_Sales_CN1_a.tOracleRow_1Process(Copy_of_String_Staging_Sales_CN1_a.java:642) 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at dwhggbnew.copy_of_string_staging_sales_cn1_a_0_1.Copy_of_String_Staging_Sales_CN1_a.tFileList_1Process(Copy_of_String_Staging_Sales_CN1_a.java:498) 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at dwhggbnew.copy_of_string_staging_sales_cn1_a_0_1.Copy_of_String_Staging_Sales_CN1_a.runJobInTOS(Copy_of_String_Staging_Sales_CN1_a.java:3046) 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; at dwhggbnew.copy_of_string_staging_sales_cn1_a_0_1.Copy_of_String_Staging_Sales_CN1_a.main(Copy_of_String_Staging_Sales_CN1_a.java:2914) 
&lt;BR /&gt;Where do I make mistake? 
&lt;BR /&gt;Best Regards, 
&lt;BR /&gt;Robert</description>
      <pubDate>Fri, 01 Aug 2014 11:42:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Exception-in-component-tMap-1-java-text-ParseException/m-p/2374252#M136878</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-01T11:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Exception in component tMap_1 java.text.ParseException Unparseable num</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Exception-in-component-tMap-1-java-text-ParseException/m-p/2374253#M136879</link>
      <description>It is not easy to trap Empty value you have to do trick like below. please try once.&amp;nbsp;
&lt;BR /&gt;
&lt;PRE&gt;row1.SALES_QTY != null|| row1.SALES_QTY !="" ? java.text.NumberFormat.getNumberInstance(java.util.Locale.GERMAN).parse(row1.SALES_QTY.trim()).doubleValue(): null&lt;/PRE&gt;
&lt;BR /&gt;or&amp;nbsp;
&lt;BR /&gt;
&lt;PRE&gt;row1.SALES_QTY != null|| row1.SALES_QTY.trim() !="" ? java.text.NumberFormat.getNumberInstance(java.util.Locale.GERMAN).parse(row1.SALES_QTY).doubleValue(): null&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Aug 2014 12:16:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Exception-in-component-tMap-1-java-text-ParseException/m-p/2374253#M136879</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-01T12:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Exception in component tMap_1 java.text.ParseException Unparseable num</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Exception-in-component-tMap-1-java-text-ParseException/m-p/2374254#M136880</link>
      <description>Dear All
&lt;BR /&gt;the following solution worked for me:
&lt;BR /&gt;row1.Column0.equals("") ? null : java.text.NumberFormat.getNumberInstance(java.util.Locale.US).parse(row1.Column0.trim()).doubleValue() &amp;nbsp;
&lt;BR /&gt;Thank you!
&lt;BR /&gt;Best Regards,
&lt;BR /&gt;Robert</description>
      <pubDate>Thu, 14 Aug 2014 12:06:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Exception-in-component-tMap-1-java-text-ParseException/m-p/2374254#M136880</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-14T12:06:46Z</dc:date>
    </item>
  </channel>
</rss>

