<?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: TMap convert variable if not null in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/TMap-convert-variable-if-not-null/m-p/2274591#M51216</link>
    <description>Hi 
&lt;BR /&gt;Check the nullable box of the column on the schema if you want to compare the object is null or not. (see my screenshot) and the expression can be: 
&lt;BR /&gt; 
&lt;PRE&gt;row2.rating ==null?null:new Double(row2.rating)&lt;/PRE&gt; 
&lt;BR /&gt;Let me know if it does't work, and show us the error message. 
&lt;BR /&gt;Shong 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDZo.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155233iBE43B37D6BFD4433/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDZo.png" alt="0683p000009MDZo.png" /&gt;&lt;/span&gt;</description>
    <pubDate>Fri, 18 Jan 2013 06:42:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-01-18T06:42:06Z</dc:date>
    <item>
      <title>TMap convert variable if not null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TMap-convert-variable-if-not-null/m-p/2274590#M51215</link>
      <description>TMap &amp;amp; Variable conversion.&lt;BR /&gt;- When I map a nullable variable to a nullable variable, everything works&lt;BR /&gt;Scenario:&lt;BR /&gt;TMap input:&lt;BR /&gt;    - var = rating; type = short&lt;BR /&gt;TMap output:&lt;BR /&gt;    - var = y; type = double&lt;BR /&gt;Normally I use the middle part to convert Variables, what works fine. Except for this statement where I want to do this:&lt;BR /&gt;Relational.ISNULL(row2.rating) ? null : (new Short(row2.rating)).doubleValue()&lt;BR /&gt;Since I am in the "conversion step" in the middle of TMAP, TMAP expects me to give back a "not null" value. For example:&lt;BR /&gt;Relational.ISNULL(row2.rating) ? -1 : (new Short(row2.rating)).doubleValue()&lt;BR /&gt;works fine, but also &lt;BR /&gt;Relational.ISNULL(row2.rating) ? row2.rating : (new Short(row2.rating)).doubleValue()&lt;BR /&gt;doesnt work. So my question is now:&lt;BR /&gt;How do I convert the variable JUST when its not null and, if it's null, how can I manage to return from the middle part a null ( since I don't want to write some arbitrary value there )&lt;BR /&gt;Thx</description>
      <pubDate>Thu, 17 Jan 2013 17:42:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TMap-convert-variable-if-not-null/m-p/2274590#M51215</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-17T17:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: TMap convert variable if not null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TMap-convert-variable-if-not-null/m-p/2274591#M51216</link>
      <description>Hi 
&lt;BR /&gt;Check the nullable box of the column on the schema if you want to compare the object is null or not. (see my screenshot) and the expression can be: 
&lt;BR /&gt; 
&lt;PRE&gt;row2.rating ==null?null:new Double(row2.rating)&lt;/PRE&gt; 
&lt;BR /&gt;Let me know if it does't work, and show us the error message. 
&lt;BR /&gt;Shong 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDZo.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155233iBE43B37D6BFD4433/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDZo.png" alt="0683p000009MDZo.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Fri, 18 Jan 2013 06:42:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TMap-convert-variable-if-not-null/m-p/2274591#M51216</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-18T06:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: TMap convert variable if not null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TMap-convert-variable-if-not-null/m-p/2274592#M51217</link>
      <description>Hi,&lt;BR /&gt;I tried your suggesstion&lt;BR /&gt;- As said: both variables are nullable&lt;BR /&gt;- Error:&lt;BR /&gt;Exception in component tMap_2&lt;BR /&gt;java.lang.NullPointerException&lt;BR /&gt;	at sync.de_orders_0_1.DE_Orders.tPostgresqlInput_2Process(DE_Orders.java:1360)&lt;BR /&gt;	at sync.de_orders_0_1.DE_Orders.runJobInTOS(DE_Orders.java:1965)&lt;BR /&gt;	at sync.de_orders_0_1.DE_Orders.main(DE_Orders.java:1833)&lt;BR /&gt;&lt;BR /&gt;I believe: When you are in the middle of the Tmap, your not able to return "null" to the "new assigned variable" , can that be the case?</description>
      <pubDate>Fri, 18 Jan 2013 10:11:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TMap-convert-variable-if-not-null/m-p/2274592#M51217</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-18T10:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: TMap convert variable if not null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TMap-convert-variable-if-not-null/m-p/2274593#M51218</link>
      <description>Hi 
&lt;BR /&gt;The error might come from another column, i can confirm the expression I gave in my previous post is correct. Can you upload a screenshot of tMap? It will be helpful for us to locate the problem. 
&lt;BR /&gt;Shong</description>
      <pubDate>Fri, 18 Jan 2013 10:17:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TMap-convert-variable-if-not-null/m-p/2274593#M51218</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-18T10:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: TMap convert variable if not null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TMap-convert-variable-if-not-null/m-p/2274594#M51219</link>
      <description>I found my mistake, I forgot to also set my return value of the expression to nullable -.-
&lt;BR /&gt;Thanks a lot for your help!</description>
      <pubDate>Fri, 18 Jan 2013 10:25:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TMap-convert-variable-if-not-null/m-p/2274594#M51219</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-18T10:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: TMap convert variable if not null</title>
      <link>https://community.qlik.com/t5/Talend-Studio/TMap-convert-variable-if-not-null/m-p/2274595#M51220</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Hi,&lt;BR /&gt;I tried your suggesstion&lt;BR /&gt;- As said: both variables are nullable&lt;BR /&gt;- Error:&lt;BR /&gt;Exception in component tMap_2&lt;BR /&gt;java.lang.NullPointerException&lt;BR /&gt;	at sync.de_orders_0_1.DE_Orders.tPostgresqlInput_2Process(DE_Orders.java:1360)&lt;BR /&gt;	at sync.de_orders_0_1.DE_Orders.runJobInTOS(DE_Orders.java:1965)&lt;BR /&gt;	at sync.de_orders_0_1.DE_Orders.main(DE_Orders.java:1833)&lt;BR /&gt;&lt;BR /&gt;I believe: When you are in the middle of the Tmap, your not able to return "null" to the "new assigned variable" , can that be the case?&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;It is usefull for me. Thank you for your sharing.</description>
      <pubDate>Fri, 25 Jan 2013 03:34:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/TMap-convert-variable-if-not-null/m-p/2274595#M51220</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-25T03:34:52Z</dc:date>
    </item>
  </channel>
</rss>

