<?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: NUMERIC TRANSFORMATION in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/NUMERIC-TRANSFORMATION/m-p/2316203#M86773</link>
    <description>&lt;P&gt;Check your schema field types.&amp;nbsp; There could be something in your component schemas changing the datatype.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;For non-integers Talend supports Double, Float, and BigDecimal.&amp;nbsp; They compute differently&amp;nbsp;and they round differently.&amp;nbsp;&amp;nbsp;The introduction of the database field types (as is the case in ETL) will also complicate matters because the Talend input/output components must to handle that conversion as well.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I generally use BigDecimal and have no issues with the way BigDecimal performs its rounding.&amp;nbsp; However, you can try using tConvertType which handles a lot of data type conversions rather gracefully.&amp;nbsp; You can also round your numbers manually using a tMap or tJavaRow with some simple Talend/Java functions.&amp;nbsp; Talend has some functions for handling numbers in its 'Mathematical' category.&amp;nbsp; Not many for rounding, but you can also use Java functions:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;Math.round()
Math.ceil()
Math.floor()&lt;/PRE&gt; 
&lt;P&gt;For your purposes, something like this in a tMap should handle it:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;Math.round(&lt;EM&gt;row1.numField&lt;/EM&gt; * 100.0) / 100.0)&lt;/PRE&gt;</description>
    <pubDate>Fri, 11 May 2018 17:25:36 GMT</pubDate>
    <dc:creator>PaulyWally</dc:creator>
    <dc:date>2018-05-11T17:25:36Z</dc:date>
    <item>
      <title>NUMERIC TRANSFORMATION</title>
      <link>https://community.qlik.com/t5/Talend-Studio/NUMERIC-TRANSFORMATION/m-p/2316202#M86772</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Would like to ask a strategy for conversion of data, I have a numeric 12, 2 from my source file then when comes to redshift I have a numeric 12, 4. I want to upload the actual data from redshift without changes in data, &lt;EM&gt;e.g&lt;/EM&gt; I have a 20.19 data but when I try to upload it on redshift it becomes 20.1899, instead of 20.1900. Now the question is what is the best way to get my sample result into redshift, I have pallettes of file &amp;gt; tmap &amp;gt; redshift&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 05:57:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/NUMERIC-TRANSFORMATION/m-p/2316202#M86772</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-09T05:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: NUMERIC TRANSFORMATION</title>
      <link>https://community.qlik.com/t5/Talend-Studio/NUMERIC-TRANSFORMATION/m-p/2316203#M86773</link>
      <description>&lt;P&gt;Check your schema field types.&amp;nbsp; There could be something in your component schemas changing the datatype.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;For non-integers Talend supports Double, Float, and BigDecimal.&amp;nbsp; They compute differently&amp;nbsp;and they round differently.&amp;nbsp;&amp;nbsp;The introduction of the database field types (as is the case in ETL) will also complicate matters because the Talend input/output components must to handle that conversion as well.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I generally use BigDecimal and have no issues with the way BigDecimal performs its rounding.&amp;nbsp; However, you can try using tConvertType which handles a lot of data type conversions rather gracefully.&amp;nbsp; You can also round your numbers manually using a tMap or tJavaRow with some simple Talend/Java functions.&amp;nbsp; Talend has some functions for handling numbers in its 'Mathematical' category.&amp;nbsp; Not many for rounding, but you can also use Java functions:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;Math.round()
Math.ceil()
Math.floor()&lt;/PRE&gt; 
&lt;P&gt;For your purposes, something like this in a tMap should handle it:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;Math.round(&lt;EM&gt;row1.numField&lt;/EM&gt; * 100.0) / 100.0)&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 May 2018 17:25:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/NUMERIC-TRANSFORMATION/m-p/2316203#M86773</guid>
      <dc:creator>PaulyWally</dc:creator>
      <dc:date>2018-05-11T17:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: NUMERIC TRANSFORMATION</title>
      <link>https://community.qlik.com/t5/Talend-Studio/NUMERIC-TRANSFORMATION/m-p/2316204#M86774</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LMOPAA4"&gt;@PaulyWally&lt;/A&gt;, thanks for your reply, for this I resolved it by adding precision to 4 in to my Tmap, also I note your solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 09:58:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/NUMERIC-TRANSFORMATION/m-p/2316204#M86774</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-17T09:58:02Z</dc:date>
    </item>
  </channel>
</rss>

