<?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: Converting String Values that are numeric into Decimal/Currency with a Reject File in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Converting-String-Values-that-are-numeric-into-Decimal-Currency/m-p/2221370#M15404</link>
    <description>&lt;P&gt;You can try to achieve it creating your custom function&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here you can find&amp;nbsp; how to create custom function:&amp;nbsp;&lt;A href="https://community.qlik.com/s/article/ka03p0000006EZrAAM" target="_blank" rel="noopener"&gt;https://community.talend.com/t5/Design-and-Development/Create-a-user-routine-and-call-it-in-a-Job/ta-p/21665&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here you can find how to check if string is a proper number in java:&amp;nbsp;&lt;A href="https://www.baeldung.com/java-check-string-number" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://www.baeldung.com/java-check-string-number&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Mar 2019 23:44:44 GMT</pubDate>
    <dc:creator>DataTeam1</dc:creator>
    <dc:date>2019-03-05T23:44:44Z</dc:date>
    <item>
      <title>Converting String Values that are numeric into Decimal/Currency with a Reject File</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-String-Values-that-are-numeric-into-Decimal-Currency/m-p/2221369#M15403</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have an Input file that I am dealing with a lot of bad numeric values in them. For instance I have values in it like "500.00/" "17.5.00" "01.00" "12.5.00". These values are suppose to be a Dollar Amount. Without knowing the actual Dollar amount of some of these values, I want Talend to reject them, so they don't end up in the output file. Is there a component in Talend than can Try to Convert a String value that has numeric data into a decimal/currency value to get these exact values into a reject file.&lt;/P&gt; 
&lt;P&gt;The code in SQL would be&amp;nbsp;TRY_CONVERT(decimal,REPLACE(amount,',','')).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Not sure if the same logic can be applied in Talend, but not trying to bring in a DB Connection and a Query to get these values into a Reject File if I don't have too.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please advise,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Andrew&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2019 21:50:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-String-Values-that-are-numeric-into-Decimal-Currency/m-p/2221369#M15403</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-05T21:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String Values that are numeric into Decimal/Currency with a Reject File</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-String-Values-that-are-numeric-into-Decimal-Currency/m-p/2221370#M15404</link>
      <description>&lt;P&gt;You can try to achieve it creating your custom function&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here you can find&amp;nbsp; how to create custom function:&amp;nbsp;&lt;A href="https://community.qlik.com/s/article/ka03p0000006EZrAAM" target="_blank" rel="noopener"&gt;https://community.talend.com/t5/Design-and-Development/Create-a-user-routine-and-call-it-in-a-Job/ta-p/21665&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here you can find how to check if string is a proper number in java:&amp;nbsp;&lt;A href="https://www.baeldung.com/java-check-string-number" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://www.baeldung.com/java-check-string-number&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2019 23:44:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-String-Values-that-are-numeric-into-Decimal-Currency/m-p/2221370#M15404</guid>
      <dc:creator>DataTeam1</dc:creator>
      <dc:date>2019-03-05T23:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String Values that are numeric into Decimal/Currency with a Reject File</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-String-Values-that-are-numeric-into-Decimal-Currency/m-p/2221371#M15405</link>
      <description>&lt;P&gt;Hi Andrew,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; Could you please try below job flow?&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 965px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2f4.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156101i774E18646D6EB382/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2f4.png" alt="0683p000009M2f4.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I was able to separate good and bad records. Please refer the tjavarow component below.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2Na.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131134i8BCD5D38E1709F51/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2Na.png" alt="0683p000009M2Na.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;The code used is:-&lt;/P&gt; 
&lt;PRE&gt;output_row.data = input_row.data;

 try{
        Float.parseFloat(input_row.data);
        output_row.flag="Y";
    }catch(NumberFormatException e){
        output_row.flag="N";
    }&lt;/PRE&gt; 
&lt;P&gt;The tMap filter logic is as shown below.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2f9.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143912i4E5E8ED8C8870EAB/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2f9.png" alt="0683p000009M2f9.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Hope I have answered your query &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 05:49:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-String-Values-that-are-numeric-into-Decimal-Currency/m-p/2221371#M15405</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-06T05:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String Values that are numeric into Decimal/Currency with a Reject File</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-String-Values-that-are-numeric-into-Decimal-Currency/m-p/2221372#M15406</link>
      <description>&lt;P&gt;Hey &lt;A href="https://community.qlik.com/s/profile/00539000006eKOgAAM"&gt;@nthampi&lt;/A&gt;&amp;nbsp;,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Can you post your tLogRow Output Basic Settings? I'm not sure how you separated the Good Values from the Bad values in the Console. For me they're all printing to the same line&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 15:10:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-String-Values-that-are-numeric-into-Decimal-Currency/m-p/2221372#M15406</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-06T15:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Converting String Values that are numeric into Decimal/Currency with a Reject File</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-String-Values-that-are-numeric-into-Decimal-Currency/m-p/2221373#M15407</link>
      <description>&lt;P&gt;Hi Andrew,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;It has nothing to do with your tLogrow. If everything is coming at same line means, either your try catch is not working or output expression in tMap has some issues.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; Could you please print the output using a tLogrow before tMap and after tjavarow to check whether flag value is getting set correctly?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 15:15:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-String-Values-that-are-numeric-into-Decimal-Currency/m-p/2221373#M15407</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-06T15:15:05Z</dc:date>
    </item>
  </channel>
</rss>

