<?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 Mathematical.Num() in Expression Builder in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Mathematical-Num-in-Expression-Builder/m-p/2304402#M76183</link>
    <description>I am trying to format a string into a specific format only if it is numeric. 
&lt;BR /&gt;I am using the following expression in the tmap. 
&lt;BR /&gt;Mathematical.NUM(row.number) ? String.format("%010d", Double.parseDouble(row.number)) : row.number&amp;nbsp; 
&lt;BR /&gt;I am getting a compilation error: 
&lt;I&gt;Type Mismatch: Cannot convert int to boolean.&lt;/I&gt;</description>
    <pubDate>Tue, 29 Mar 2016 16:19:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-03-29T16:19:27Z</dc:date>
    <item>
      <title>Mathematical.Num() in Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Mathematical-Num-in-Expression-Builder/m-p/2304402#M76183</link>
      <description>I am trying to format a string into a specific format only if it is numeric. 
&lt;BR /&gt;I am using the following expression in the tmap. 
&lt;BR /&gt;Mathematical.NUM(row.number) ? String.format("%010d", Double.parseDouble(row.number)) : row.number&amp;nbsp; 
&lt;BR /&gt;I am getting a compilation error: 
&lt;I&gt;Type Mismatch: Cannot convert int to boolean.&lt;/I&gt;</description>
      <pubDate>Tue, 29 Mar 2016 16:19:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Mathematical-Num-in-Expression-Builder/m-p/2304402#M76183</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-29T16:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Mathematical.Num() in Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Mathematical-Num-in-Expression-Builder/m-p/2304403#M76184</link>
      <description>Hi,
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;Mathematical.NUM(row.number) ? String.format("%010d", Double.parseDouble(row.number)) : row.number &lt;/FONT&gt;&lt;/FONT&gt;&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;
&lt;FONT size="2"&gt;&lt;FONT face="Calibri, sans-serif"&gt;Could you please elaborate your case with an example with input and expected output values?&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT face="Calibri, sans-serif"&gt;&lt;FONT size="2"&gt;Would you mind posting your tMap editor screenshot into forum?&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT face="Calibri, sans-serif"&gt;&lt;FONT size="2"&gt;Best regards&lt;/FONT&gt;&lt;/FONT&gt;
&lt;BR /&gt;
&lt;FONT face="Calibri, sans-serif"&gt;&lt;FONT size="2"&gt;Sabrina&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Wed, 30 Mar 2016 03:59:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Mathematical-Num-in-Expression-Builder/m-p/2304403#M76184</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-30T03:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Mathematical.Num() in Expression Builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Mathematical-Num-in-Expression-Builder/m-p/2304404#M76185</link>
      <description>You are getting that error since that 1-line if-else statement needs a 
&lt;I&gt;BOOLEAN&lt;/I&gt; expression at the left side, but Mathematical.NUM returns an 
&lt;I&gt;INTEGER &lt;/I&gt;value 1 if the parameter passed is a numeric data type, or 0 if otherwise. So you have to add a bit of code to your decision statement, such that it checks if the returned value is equal to 1 or not (added code in red bold): 
&lt;BR /&gt; 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;Mathematical.NUM(row.number) &lt;B&gt;&lt;FONT color="#ff3333"&gt;== 1&lt;/FONT&gt;&lt;/B&gt;? String.format("%010d", Double.parseDouble(row.number)) : row.number&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Thu, 31 Mar 2016 10:31:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Mathematical-Num-in-Expression-Builder/m-p/2304404#M76185</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-31T10:31:03Z</dc:date>
    </item>
  </channel>
</rss>

