<?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: String to Double conversion in tmap in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/String-to-Double-conversion-in-tmap/m-p/2339475#M107612</link>
    <description>Hi Swathi 
&lt;BR /&gt;I still remember we talked about this issue at 23342. 
&lt;BR /&gt;I think the most convenient way is not converting datatype in this expression. 
&lt;BR /&gt;Just choose String datatype in tMap. Then link it with tConvertType to change it from String to Double. 
&lt;BR /&gt;Your expression above is wrong. Because "0" is String. Double.parseDouble(row1.tracking_id_charge_amount3) is Double. 
&lt;BR /&gt;There are two datatypes in the same column. 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Pedro</description>
    <pubDate>Fri, 04 May 2012 07:52:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-05-04T07:52:09Z</dc:date>
    <item>
      <title>String to Double conversion in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/String-to-Double-conversion-in-tmap/m-p/2339474#M107611</link>
      <description>Hi, 
&lt;BR /&gt;I have 25 columns and have a requirement where in we need to search for a value in every column. Like if "Fuel Surcharge" is in ABCD then consider the amount value from the column ABCD_1, or if "Fuel Surcharge" is in EFGH then consider the amount value in EFGH_2, or if "Fuel Surcharge" is in IJKL then consider the amount value in IJKL_3, or if "Fuel Surcharge" is not in any of the following columns, then consider 0. 
&lt;BR /&gt;I have written the condition for the "Fuel Surcharge" column in tmap like, 
&lt;BR /&gt;row1.tracking_id_charge_description.equals("Fuel Surcharge")?Double.parseDouble(row1.tracking_id_charge_amount1) 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt;row1.tracking_id_charge_description1.equals("Fuel Surcharge")?Double.parseDouble(row1.tracking_id_charge_amount2) 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt;row1.tracking_id_charge_description2.equals("Fuel Surcharge")?Double.parseDouble(row1.tracking_id_charge_amount3):"0")))))))))))))))))))))))) 
&lt;BR /&gt;Here, Description columns has datatype String and Amount columns has datatype Double. I have written the above function for new column "Fuel Surcharge" which has a datatype Double. 
&lt;BR /&gt;When I Execute, I get this Error: Type mismatch: cannot convert from Object&amp;amp;Comparable&amp;lt;?&amp;gt;&amp;amp;Serializable to Double 
&lt;BR /&gt; 
&lt;BR /&gt;Please Help 
&lt;BR /&gt; 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Swathi</description>
      <pubDate>Fri, 04 May 2012 07:26:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/String-to-Double-conversion-in-tmap/m-p/2339474#M107611</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-04T07:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: String to Double conversion in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/String-to-Double-conversion-in-tmap/m-p/2339475#M107612</link>
      <description>Hi Swathi 
&lt;BR /&gt;I still remember we talked about this issue at 23342. 
&lt;BR /&gt;I think the most convenient way is not converting datatype in this expression. 
&lt;BR /&gt;Just choose String datatype in tMap. Then link it with tConvertType to change it from String to Double. 
&lt;BR /&gt;Your expression above is wrong. Because "0" is String. Double.parseDouble(row1.tracking_id_charge_amount3) is Double. 
&lt;BR /&gt;There are two datatypes in the same column. 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Pedro</description>
      <pubDate>Fri, 04 May 2012 07:52:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/String-to-Double-conversion-in-tmap/m-p/2339475#M107612</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-04T07:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: String to Double conversion in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/String-to-Double-conversion-in-tmap/m-p/2339476#M107613</link>
      <description>Hi Pedro,
&lt;BR /&gt;Yes I have written that function with your help. I want the column to be double, because that column need to be used to create a metric. Thanks a lot again, will use tConvertType
&lt;BR /&gt;
&lt;BR /&gt;Regards,
&lt;BR /&gt;Swathi</description>
      <pubDate>Fri, 04 May 2012 08:00:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/String-to-Double-conversion-in-tmap/m-p/2339476#M107613</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-04T08:00:19Z</dc:date>
    </item>
  </channel>
</rss>

