<?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: Weird NullPointerException in tMap in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236708#M25360</link>
    <description>&lt;P&gt;OK so I just replaced the "null" in the last nested if with a numeric value and it works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Relational.ISNULL(account_transaction.date_entree) || Relational.ISNULL(account_transaction.date_sortie)
	? null
	: TalendDate.diffDate(account_transaction.date_sortie, account_transaction.date_entree, "HH") &amp;lt;= 5
		? 0.0
		: Relational.ISNULL(calcul_taxe_sejour.taxe_sejour)
			? -1.0
			: calcul_taxe_sejour.taxe_sejour &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even if&amp;nbsp;the output column is set as nullable since the beginning.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now&amp;nbsp;comes another question: how come the "null" in the first "if" does not trigger the same error? I checked and there are rows that satisfy the first condition and these were set to null...&lt;/P&gt;</description>
    <pubDate>Wed, 03 Oct 2018 10:50:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-10-03T10:50:30Z</dc:date>
    <item>
      <title>Weird NullPointerException in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236699#M25351</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm getting a NullPointerException when trying to calculate an expression in a tMap that has 2 inputs.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here is the syntax of the expression:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;Relational.ISNULL(account_transaction.date_entree) || Relational.ISNULL(account_transaction.date_sortie)
	? null
	: TalendDate.diffDate(account_transaction.date_sortie, account_transaction.date_entree, "HH") &amp;lt;= 5
		? 0.0
		: Relational.ISNULL(calcul_taxe_sejour.taxe_sejour)
			? null
			: calcul_taxe_sejour.taxe_sejour &lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;account_transaction is my Main and calcul_taxe_sejour is my Lookup.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The error is raised on this line of the expression:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;		: Relational.ISNULL(calcul_taxe_sejour.taxe_sejour)&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;but everything is correctly written for the Lookup flow and moreover the job compiles:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erreur_talend.png" style="width: 357px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M09a.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147031i3E374EC09DD256F2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M09a.png" alt="0683p000009M09a.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Also I set up the field as nullable.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I don't understand what the problem is.&amp;nbsp;If anyone can suggest a few things I can try to debug that would be awesome.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thx!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 05:22:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236699#M25351</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-03T05:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Weird NullPointerException in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236700#M25352</link>
      <description>1: I m used to write like (condition)?true:false when there is more than one condition
&lt;BR /&gt;2: why dont you use calcul_taxe_sejour.taxe_sejour!=null
&lt;BR /&gt;3: is calcul_taxe_sejour != null
&lt;BR /&gt;Regards
&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Oct 2018 08:48:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236700#M25352</guid>
      <dc:creator>fdenis</dc:creator>
      <dc:date>2018-10-03T08:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Weird NullPointerException in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236701#M25353</link>
      <description>&lt;P&gt;Can you please elaborate the entire tmap configuation with a screenshot ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks ,&lt;/P&gt;&lt;P&gt;Praveen M.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 08:58:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236701#M25353</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-03T08:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Weird NullPointerException in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236702#M25354</link>
      <description>&lt;P&gt;I suspect your issue is that the column you are passing the data to is not nullable. Your code looks OK, but it will enable a null output. In your output schema, check that the column is nullable.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 09:14:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236702#M25354</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-03T09:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Weird NullPointerException in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236703#M25355</link>
      <description>1: You mean group everything under 1 condition? But then how do you manage multiple output values (here I can have null, 0.0 or a field value)? 
&lt;BR /&gt;2: I've always used Relational.ISNULL, but I don't remember where I learnt that 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACJ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133049iD780B7DE0116E4D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACJ.png" alt="0683p000009MACJ.png" /&gt;&lt;/span&gt; Anyway I tested and it's giving the same error. 
&lt;BR /&gt;3: Not sure what you mean here, calcul_taxe_sejour can be null which is why I'm trying to handle it.</description>
      <pubDate>Wed, 03 Oct 2018 09:39:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236703#M25355</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-03T09:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Weird NullPointerException in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236704#M25356</link>
      <description>I added 2 screenshots with the tMap configuration 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Wed, 03 Oct 2018 09:39:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236704#M25356</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-03T09:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Weird NullPointerException in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236705#M25357</link>
      <description>Nope I mentioned this, this is the first thing I checked but all the fields in the tMap output are nullable &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;</description>
      <pubDate>Wed, 03 Oct 2018 09:40:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236705#M25357</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-03T09:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Weird NullPointerException in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236706#M25358</link>
      <description>remove the identified wrong part of the condition then run to retrive all data used into this condition.
&lt;BR /&gt;does it work?
&lt;BR /&gt;did you have null values?
&lt;BR /&gt;did you have blanc values?</description>
      <pubDate>Wed, 03 Oct 2018 09:50:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236706#M25358</guid>
      <dc:creator>fdenis</dc:creator>
      <dc:date>2018-10-03T09:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Weird NullPointerException in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236707#M25359</link>
      <description>&lt;P&gt;I suspect that the error line is misleading here. Take a look at this mini tutorial (&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCx4vCAC#M9" target="_blank"&gt;https://community.talend.com/t5/How-Tos-and-Best-Practices/How-to-debug-tMap-errors/m-p/40951#M9&lt;/A&gt;) on debugging tMap errors. This is a useful and relatively easy way of trapping issues like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 09:57:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236707#M25359</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-03T09:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Weird NullPointerException in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236708#M25360</link>
      <description>&lt;P&gt;OK so I just replaced the "null" in the last nested if with a numeric value and it works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Relational.ISNULL(account_transaction.date_entree) || Relational.ISNULL(account_transaction.date_sortie)
	? null
	: TalendDate.diffDate(account_transaction.date_sortie, account_transaction.date_entree, "HH") &amp;lt;= 5
		? 0.0
		: Relational.ISNULL(calcul_taxe_sejour.taxe_sejour)
			? -1.0
			: calcul_taxe_sejour.taxe_sejour &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even if&amp;nbsp;the output column is set as nullable since the beginning.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now&amp;nbsp;comes another question: how come the "null" in the first "if" does not trigger the same error? I checked and there are rows that satisfy the first condition and these were set to null...&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 10:50:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236708#M25360</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-03T10:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Weird NullPointerException in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236709#M25361</link>
      <description>if trouble is on output you may cast your result even if null.&lt;BR /&gt;&lt;BR /&gt;(Relational.ISNULL(account_transaction.date_entree) || Relational.ISNULL(account_transaction.date_sortie)&lt;BR /&gt;? (Integer)null&lt;BR /&gt;: TalendDate.diffDate(account_transaction.date_sortie, account_transaction.date_entree, "HH") &amp;lt;= 5&lt;BR /&gt;? 0.0&lt;BR /&gt;: Relational.ISNULL(calcul_taxe_sejour.taxe_sejour)&lt;BR /&gt;? (Integer)null&lt;BR /&gt;: calcul_taxe_sejour.taxe_sejour )&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Oct 2018 10:59:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236709#M25361</guid>
      <dc:creator>fdenis</dc:creator>
      <dc:date>2018-10-03T10:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Weird NullPointerException in tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236710#M25362</link>
      <description>&lt;P&gt;Can you show us your output schema? Either your column is not set to nullable or there is a bug&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 12:12:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-NullPointerException-in-tMap/m-p/2236710#M25362</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-03T12:12:37Z</dc:date>
    </item>
  </channel>
</rss>

