<?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: [resolved] how to check for string null value in tMap in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314670#M85413</link>
    <description>&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;Hi there,&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;I have a requirement which says-&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;If Preferred is 'Yes'&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;&amp;nbsp; &amp;nbsp; and Email is not null then populate Email&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;&amp;nbsp; &amp;nbsp; else populate SecondaryEmail&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;I am using the below given expression in tMap,&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;&amp;nbsp;(row2.Preferred == "Yes" &amp;amp;&amp;amp; (row2.E_Mail_Number != null || StringHandling.TRIM(row2.E_Mail_Number).length() &amp;gt; 0 || (!row2.E_Mail_Number.isEmpty()))) ? row2.E_Mail_Number : row2.Convio_Email_Number&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;It is not giving me an error, but I am unable to populate any of the Emails&lt;/FONT&gt;&lt;/FONT&gt;</description>
    <pubDate>Thu, 20 Oct 2016 14:30:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-10-20T14:30:16Z</dc:date>
    <item>
      <title>[resolved] how to check for string null value in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314664#M85407</link>
      <description>Input is csv file where all fields in schema are defined as string.  Some values may be null but need to be handled.&lt;BR /&gt;For example, the DIRECTORID field may be empty in the csv input.  The target field DIRECTOR_ID in the database is BigDecimal which will be set to zero if the source value is null or empty.&lt;BR /&gt;To test, I have used a log row which has fields with String data type:&lt;BR /&gt;tFileInputDelimited  ----&amp;gt;  tMap  -----&amp;gt; tLogRow&lt;BR /&gt;  (ParsedData)&lt;BR /&gt;&lt;BR /&gt;Tried to use the following:&lt;BR /&gt;1)  ParsedData.DIRECTORID == null ? "0": ParsedData.DIRECTORID&lt;BR /&gt;2)  ParsedData.DIRECTORID == "" ? "0": ParsedData.DIRECTORID&lt;BR /&gt;I was expecting a "0" when the ParsedData.DIRECTORID was empty but got nothing instead.&lt;BR /&gt;What am I doing wrong?&lt;BR /&gt;Thanks.&lt;BR /&gt;p.s. I tried posting an image but it just won't post....&lt;BR /&gt;sample source data where field separator is "~;" and row separator is "~\n" (without the quotes)  :&lt;BR /&gt;1718~;19~;MA~;340~;Goodwin, Steve~&lt;BR /&gt;1718~;18~;MD~;~;,~&lt;BR /&gt;1718~;5~;MI~;203~;Pueppke, Steven G.~&lt;BR /&gt;schema (all String datatype):&lt;BR /&gt;TRACKID&lt;BR /&gt;STATIONID&lt;BR /&gt;STATIONNAME&lt;BR /&gt;DIRECTORID&lt;BR /&gt;DIRECTORNAME&lt;BR /&gt;The second row has empty DIRECTORID and "," value for DIRECTORNAME.&lt;BR /&gt;The resulting row in the log (from the console) is:&lt;BR /&gt;1718|19|MA|340|Goodwin, Steve&lt;BR /&gt;1718|18|MD||,&lt;BR /&gt;1718|5|MI|203|Pueppke, Steven G.</description>
      <pubDate>Sat, 16 Nov 2024 13:47:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314664#M85407</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] how to check for string null value in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314665#M85408</link>
      <description>&lt;PRE&gt;(ParsedData.DIRECTORID == null || ParsedData.DIRECTORID.equals("")) ? "0" : ParsedData.DIRECTORID&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Sep 2009 15:15:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314665#M85408</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-03T15:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] how to check for string null value in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314666#M85409</link>
      <description>Morbo, that seems to have worked. So I take it that the expression with the "==null" did not apply in this case? 
&lt;BR /&gt;Thanks.</description>
      <pubDate>Thu, 03 Sep 2009 15:32:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314666#M85409</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-03T15:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] how to check for string null value in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314667#M85410</link>
      <description>== only works for testing null object instance or primitive types (int, short, long, boolean, ...).&lt;BR /&gt;"String" isn't a primitive type, so you have to use the methods equals() to compare 2 Strings.</description>
      <pubDate>Thu, 03 Sep 2009 15:38:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314667#M85410</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-03T15:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] how to check for string null value in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314668#M85411</link>
      <description>So you know by now that I am weak in java and oo languages. I have been spoiled by Oracle PLSQL and SQL for many many years. I studied java many years back but never "practiced". It's really great to have helpful people like you.
&lt;BR /&gt;Thanks again.
&lt;BR /&gt;Edmund</description>
      <pubDate>Thu, 03 Sep 2009 15:46:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314668#M85411</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-03T15:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] how to check for string null value in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314669#M85412</link>
      <description>Np, it's impossible to be efficient in every CS fields, that's why we have to help each other (I suck in PLSQL 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt;).</description>
      <pubDate>Thu, 03 Sep 2009 15:57:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314669#M85412</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-03T15:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] how to check for string null value in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314670#M85413</link>
      <description>&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;Hi there,&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;I have a requirement which says-&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;If Preferred is 'Yes'&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;&amp;nbsp; &amp;nbsp; and Email is not null then populate Email&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;&amp;nbsp; &amp;nbsp; else populate SecondaryEmail&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;I am using the below given expression in tMap,&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;&amp;nbsp;(row2.Preferred == "Yes" &amp;amp;&amp;amp; (row2.E_Mail_Number != null || StringHandling.TRIM(row2.E_Mail_Number).length() &amp;gt; 0 || (!row2.E_Mail_Number.isEmpty()))) ? row2.E_Mail_Number : row2.Convio_Email_Number&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="noto, Helvetica, Arial, sans-serif"&gt;It is not giving me an error, but I am unable to populate any of the Emails&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Thu, 20 Oct 2016 14:30:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314670#M85413</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-20T14:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] how to check for string null value in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314671#M85414</link>
      <description>As above, you have to use .equals to compare two String values. &amp;nbsp;So your first expression would be row2.Preferred.equals("Yes"). 
&lt;BR /&gt;The third expression in your E_Mail_Number check is probably superfluous, as checking for a zero length trimmed String will cover the cases covered by .isEmpty. &amp;nbsp;</description>
      <pubDate>Thu, 20 Oct 2016 16:01:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314671#M85414</guid>
      <dc:creator>cterenzi</dc:creator>
      <dc:date>2016-10-20T16:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] how to check for string null value in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314672#M85415</link>
      <description>&lt;P&gt;How can i populate Null&amp;nbsp; i database for Boolean value if it is null from tmap. I am able to separate the boolean null value using the condition row1.flag ==null but when i am trying to put null or zero value its saying type mismatch.I am using row1.flag==null ?0 : row1.flag.&lt;/P&gt;
&lt;P&gt;Can anyone please help me that what i am doing wrong.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jun 2018 17:04:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-how-to-check-for-string-null-value-in-tMap/m-p/2314672#M85415</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-24T17:04:48Z</dc:date>
    </item>
  </channel>
</rss>

