<?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 Boolean conversion not working in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/String-to-Boolean-conversion-not-working/m-p/2241930#M28920</link>
    <description>&lt;P&gt;quick tip with the .equals() and .equalsIgnoreCase() methods: If you write them "backwards" by calling the method from your string constant, you'll avoid nullpointer exceptions when your input data is null.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this will not throw a NPE when row1.data is null&lt;/P&gt;
&lt;PRE&gt;"1".equals(row1.data) ? true : false&lt;/PRE&gt;</description>
    <pubDate>Thu, 04 Oct 2018 18:03:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-10-04T18:03:56Z</dc:date>
    <item>
      <title>String to Boolean conversion not working</title>
      <link>https://community.qlik.com/t5/Talend-Studio/String-to-Boolean-conversion-not-working/m-p/2241927#M28917</link>
      <description>&lt;P&gt;In a simple tMap mapping, I need to convert a string to boolean. The data is all 0s/1s and I am using&amp;nbsp;Boolean.valueOf(variable) and all I am seeing is 'false' being returned. What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've validated everything using tLogRow on both the sides of the tMap. The input clearly prints all the 0s and 1s. The output of tMap is all false.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 17:07:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/String-to-Boolean-conversion-not-working/m-p/2241927#M28917</guid>
      <dc:creator>sushantV</dc:creator>
      <dc:date>2018-10-04T17:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: String to Boolean conversion not working</title>
      <link>https://community.qlik.com/t5/Talend-Studio/String-to-Boolean-conversion-not-working/m-p/2241928#M28918</link>
      <description>&lt;P&gt;According to java docs Boolean.valueOf(String s):&lt;/P&gt;&lt;PRE&gt;Returns a Boolean with a value represented by the specified string. The Boolean returned represents a true value if the string argument is not null and is equal, ignoring case, to the string "true".&lt;/PRE&gt;&lt;P&gt;Since your input of "0" or "1" is not "true" All will be evaluated to false&lt;/P&gt;&lt;P&gt;try this instead&lt;/P&gt;&lt;PRE&gt;row1.data.equals("1") ? true : false&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Oct 2018 17:11:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/String-to-Boolean-conversion-not-working/m-p/2241928#M28918</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-04T17:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: String to Boolean conversion not working</title>
      <link>https://community.qlik.com/t5/Talend-Studio/String-to-Boolean-conversion-not-working/m-p/2241929#M28919</link>
      <description>&lt;P&gt;Yeah I figured that. Using "1".equals(column name). Slightly shorter to type.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 18:01:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/String-to-Boolean-conversion-not-working/m-p/2241929#M28919</guid>
      <dc:creator>sushantV</dc:creator>
      <dc:date>2018-10-04T18:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: String to Boolean conversion not working</title>
      <link>https://community.qlik.com/t5/Talend-Studio/String-to-Boolean-conversion-not-working/m-p/2241930#M28920</link>
      <description>&lt;P&gt;quick tip with the .equals() and .equalsIgnoreCase() methods: If you write them "backwards" by calling the method from your string constant, you'll avoid nullpointer exceptions when your input data is null.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this will not throw a NPE when row1.data is null&lt;/P&gt;
&lt;PRE&gt;"1".equals(row1.data) ? true : false&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Oct 2018 18:03:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/String-to-Boolean-conversion-not-working/m-p/2241930#M28920</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-04T18:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: String to Boolean conversion not working</title>
      <link>https://community.qlik.com/t5/Talend-Studio/String-to-Boolean-conversion-not-working/m-p/2241931#M28921</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to convert data type string to boolean. input data is T/F.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;getting an error: Cannot convert "F" to Boolean&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jul 2022 11:05:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/String-to-Boolean-conversion-not-working/m-p/2241931#M28921</guid>
      <dc:creator>BA621858188</dc:creator>
      <dc:date>2022-07-17T11:05:22Z</dc:date>
    </item>
  </channel>
</rss>

