<?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 check if some column has string value in it in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-check-if-some-column-has-string-value-in-it/m-p/2298411#M70882</link>
    <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Hi,&lt;BR /&gt;In the table i have column of data type decimal(12,6) in infobright (mysql) db ,the values in the column have the values&lt;BR /&gt;as below:&lt;BR /&gt;356.400000&lt;BR /&gt;************&lt;BR /&gt;-129.840000&lt;BR /&gt;how to replace this **** value in the column to zero wherever it occurs&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Read it as a string from db, and then convert it from String to BigDecimal on tMap with the expression as below: 
&lt;BR /&gt; 
&lt;PRE&gt;row1.columnName.contains("*")?new java.math.BigDecimal("0"):new java.math.BigDecimal(row1.columnName)&lt;/PRE&gt; 
&lt;BR /&gt;Shong</description>
    <pubDate>Thu, 01 Aug 2013 15:31:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-08-01T15:31:56Z</dc:date>
    <item>
      <title>How to check if some column has string value in it</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-check-if-some-column-has-string-value-in-it/m-p/2298407#M70878</link>
      <description>Hi All,&lt;BR /&gt;I'm working on one scenario. I have one column which is string and I need to store that as Integer in Target.&lt;BR /&gt;I know I can convert that using Integer.parseInt() function but the problem is source column have both string as well as numeric value in it. So I want to store numeric value as int in target and string value as null.&lt;BR /&gt;EX :&lt;BR /&gt;Source (varchar())                    Target (Int)&lt;BR /&gt;123                                                123&lt;BR /&gt;ABC                                               null&lt;BR /&gt;&lt;BR /&gt;Please suggest your views on the above mentioned scenario.&lt;BR /&gt;Thanks,</description>
      <pubDate>Sat, 16 Nov 2024 12:50:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-check-if-some-column-has-string-value-in-it/m-p/2298407#M70878</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2024-11-16T12:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if some column has string value in it</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-check-if-some-column-has-string-value-in-it/m-p/2298408#M70879</link>
      <description>Hi
&lt;BR /&gt;Write a routine and hard code to check if the input string is a numeric or a string. For example, go to Repository--&amp;gt;Code--&amp;gt;Routines and create a routine, let's call it MyRoutines:
&lt;BR /&gt;
&lt;PRE&gt;package routines;&lt;BR /&gt;public class MyRoutines {&lt;BR /&gt;  &lt;BR /&gt;    public static Boolean isNumeric(String str) {&lt;BR /&gt;    	if(str.equals("")){&lt;BR /&gt;    		return false;&lt;BR /&gt;    	}&lt;BR /&gt;    	for(int i=str.length();--i&amp;gt;=0;){ &lt;BR /&gt;    		int chr=str.charAt(i); &lt;BR /&gt;    		if((chr&amp;lt;48&amp;amp;&amp;amp;chr!=45)|| chr&amp;gt;57) &lt;BR /&gt;    		return false;&lt;BR /&gt;    		} &lt;BR /&gt;    		return true;&lt;BR /&gt;    }&lt;BR /&gt;}&lt;/PRE&gt;
&lt;BR /&gt;and then call this routine in the job, 
&lt;BR /&gt;tFileInputDelimited--row1--tMap--tMysqlOutput
&lt;BR /&gt;MyRoutines.isNumeric(row1.columnName)?Integer.parseInt(row1.columnName):null
&lt;BR /&gt;Let us know if you have any troubles.
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Tue, 28 Jun 2011 02:08:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-check-if-some-column-has-string-value-in-it/m-p/2298408#M70879</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-28T02:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if some column has string value in it</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-check-if-some-column-has-string-value-in-it/m-p/2298409#M70880</link>
      <description>Mathematical.NUM(&amp;lt;var&amp;gt;) will return 1 if the string parameter is all digits.</description>
      <pubDate>Tue, 28 Jun 2011 06:05:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-check-if-some-column-has-string-value-in-it/m-p/2298409#M70880</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2011-06-28T06:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if some column has string value in it</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-check-if-some-column-has-string-value-in-it/m-p/2298410#M70881</link>
      <description>Hi,&lt;BR /&gt;In the table i have column of data type decimal(12,6) in infobright (mysql) db ,the values in the column have the values&lt;BR /&gt;as below:&lt;BR /&gt;356.400000&lt;BR /&gt;************&lt;BR /&gt;-129.840000&lt;BR /&gt;how to replace this **** value in the column to zero wherever it occurs</description>
      <pubDate>Thu, 01 Aug 2013 11:14:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-check-if-some-column-has-string-value-in-it/m-p/2298410#M70881</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-08-01T11:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if some column has string value in it</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-check-if-some-column-has-string-value-in-it/m-p/2298411#M70882</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Hi,&lt;BR /&gt;In the table i have column of data type decimal(12,6) in infobright (mysql) db ,the values in the column have the values&lt;BR /&gt;as below:&lt;BR /&gt;356.400000&lt;BR /&gt;************&lt;BR /&gt;-129.840000&lt;BR /&gt;how to replace this **** value in the column to zero wherever it occurs&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Read it as a string from db, and then convert it from String to BigDecimal on tMap with the expression as below: 
&lt;BR /&gt; 
&lt;PRE&gt;row1.columnName.contains("*")?new java.math.BigDecimal("0"):new java.math.BigDecimal(row1.columnName)&lt;/PRE&gt; 
&lt;BR /&gt;Shong</description>
      <pubDate>Thu, 01 Aug 2013 15:31:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-check-if-some-column-has-string-value-in-it/m-p/2298411#M70882</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-01T15:31:56Z</dc:date>
    </item>
  </channel>
</rss>

