<?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: How to multiply field values with numbers in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-multiply-field-values-with-numbers/m-p/2368346#M131622</link>
    <description>After trawling this forum, found a resolution that works for me (thanks to bouga74):
&lt;BR /&gt;Raw.TransactionType == 1 &amp;amp;&amp;amp; Raw.AgentNo &amp;gt; 100000 ? Raw.TranAmount.multiply(BigDecimal.valueOf(0.07)) : new java.math.BigDecimal(0) 
&lt;BR /&gt;I had previously also tried the .multiply function but then the problem was that the 0.07 was not a BigDecimal itself!
&lt;BR /&gt;Cheers
&lt;BR /&gt;Colin</description>
    <pubDate>Tue, 04 Oct 2011 11:19:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-10-04T11:19:47Z</dc:date>
    <item>
      <title>How to multiply field values with numbers</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-multiply-field-values-with-numbers/m-p/2368345#M131621</link>
      <description>Hi, 
&lt;BR /&gt; I have an ETL job that uses the tMap control to map a BigDecimal input field to a BigDecimal output field. The result in the output field should be Raw.TranAmount * 0.07. The expression in the tMap mapping is as below: 
&lt;BR /&gt;Raw.TransactionType == 1 &amp;amp;&amp;amp; Raw.AgentNo &amp;gt; 100000 ? Raw.TranAmount * 0.07 : 0 
&lt;BR /&gt;Basically, if transactiontype = 1 and agentno &amp;gt; 100000 then set the output to tranmount * 0.07 
&lt;BR /&gt;However I get java compilation errors saying that 'The operator * is undefined for the argument type(s) BigDecimal, double'. If I try the following: 
&lt;BR /&gt;Raw.TransactionType == 1 &amp;amp;&amp;amp; Raw.AgentNo &amp;gt; 100000 ? 10 * 0.07 : 0 
&lt;BR /&gt;that works fine, so I know it is just having a problem multiplying the value from field Raw.TranAmount with 0.07. 
&lt;BR /&gt;I've tried various java/groovy functions like .multiply but still no good. Surely someone must have needed to do this before. Any suggestions (I'm new to Groovy)? 
&lt;BR /&gt;Thanks! 
&lt;BR /&gt;Colin</description>
      <pubDate>Sat, 16 Nov 2024 12:38:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-multiply-field-values-with-numbers/m-p/2368345#M131621</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to multiply field values with numbers</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-multiply-field-values-with-numbers/m-p/2368346#M131622</link>
      <description>After trawling this forum, found a resolution that works for me (thanks to bouga74):
&lt;BR /&gt;Raw.TransactionType == 1 &amp;amp;&amp;amp; Raw.AgentNo &amp;gt; 100000 ? Raw.TranAmount.multiply(BigDecimal.valueOf(0.07)) : new java.math.BigDecimal(0) 
&lt;BR /&gt;I had previously also tried the .multiply function but then the problem was that the 0.07 was not a BigDecimal itself!
&lt;BR /&gt;Cheers
&lt;BR /&gt;Colin</description>
      <pubDate>Tue, 04 Oct 2011 11:19:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-multiply-field-values-with-numbers/m-p/2368346#M131622</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-04T11:19:47Z</dc:date>
    </item>
  </channel>
</rss>

