<?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: Null value being passed from Global Variable in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Null-value-being-passed-from-Global-Variable/m-p/2230355#M21006</link>
    <description>&lt;P&gt;Consider a SOQL (or SQL) query as a string.&lt;BR /&gt;This string can be a constant such as "SELECT myField FROM myObject" or it may have variable parts for the condition.&lt;BR /&gt;Start by thinking what the request should look like, for example "SELECT myField FROM myObject WHERE myField = 'AAA'".&lt;BR /&gt;Here "AAA" is not fixed but is included into a global variable (let say myGlobal).&lt;BR /&gt;So, you need to construct the request with a fixed part, completed with the content of a global variable and an other fixed part to finish.&lt;BR /&gt;The result should be:&lt;BR /&gt;"SELECT myField FROM myObject WHERE myField = '" + (String)globalMap.get("myGlobal") + "'"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pay attention at the&amp;nbsp;globalMap.get syntax, the variable name is a constant "myGlobal" or contained into an other variable (&lt;SPAN&gt;Country2 for example in your case) which must be known to be used.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jun 2020 13:16:30 GMT</pubDate>
    <dc:creator>TRF</dc:creator>
    <dc:date>2020-06-24T13:16:30Z</dc:date>
    <item>
      <title>Null value being passed from Global Variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-value-being-passed-from-Global-Variable/m-p/2230351#M21002</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the below query in tSalesforceInput component.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;" select id
from Account where Id = '"+globalMap.get("f4.AccountId" ).toString() + "' AND Brand__c in

( '"+globalMap.get("f4.Brand_1").toString() +"' ,
'"+globalMap.get("f4.Brand_2").toString() +"' ,
'"+globalMap.get("f4.Brand_3").toString() +"' )
"&lt;/PRE&gt;&lt;P&gt;The problem is, out of three global variables -&amp;nbsp; f4.brand_1, f4.brand_2, and&amp;nbsp; f4.brand_3 only one can have a value in one iteration, due to which the system throws null pointer exception.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How i resolve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:05:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-value-being-passed-from-Global-Variable/m-p/2230351#M21002</guid>
      <dc:creator>Jennifer_siders</dc:creator>
      <dc:date>2024-11-16T02:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Null value being passed from Global Variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-value-being-passed-from-Global-Variable/m-p/2230352#M21003</link>
      <description>&lt;P&gt;This one should work:&lt;/P&gt;&lt;PRE&gt;"SELECT id
  FROM Account WHERE Id = '"+globalMap.get("f4.AccountId" ).toString() + "' " +
	"AND Brand__c IN ('" +
	globalMap.get("f4.Brand_1") != null ? globalMap.get("f4.Brand_1").toString() :
		globalMap.get("f4.Brand_2") != null ? globalMap.get("f4.Brand_2").toString() :
			globalMap.get("f4.Brand_3").toString() +
	"')"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 07:20:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-value-being-passed-from-Global-Variable/m-p/2230352#M21003</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2020-06-23T07:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Null value being passed from Global Variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-value-being-passed-from-Global-Variable/m-p/2230353#M21004</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LKj7AAG"&gt;@TRF&lt;/A&gt;&amp;nbsp;, unfortunately, i am still getting a null point exception at tsalesforceinput. Could you please help me understand the query construction - i am actually bit confused with the syntax while using global variables(being from non programming background), using + or double quotes in the query below.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 11:17:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-value-being-passed-from-Global-Variable/m-p/2230353#M21004</guid>
      <dc:creator>Jennifer_siders</dc:creator>
      <dc:date>2020-06-24T11:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Null value being passed from Global Variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-value-being-passed-from-Global-Variable/m-p/2230354#M21005</link>
      <description>Also, if i need to construct a query using the syntax which utilises +, " " -&lt;BR /&gt;&lt;BR /&gt;My query which need the conversion is :&lt;BR /&gt;select id from account where country IN ( 'GlobalMap.get(Country1) ' ,&lt;BR /&gt;'GlobalMap.get(Country2) ' ,&lt;BR /&gt;'GlobalMap.get(Country3) )</description>
      <pubDate>Wed, 24 Jun 2020 12:02:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-value-being-passed-from-Global-Variable/m-p/2230354#M21005</guid>
      <dc:creator>Jennifer_siders</dc:creator>
      <dc:date>2020-06-24T12:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Null value being passed from Global Variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-value-being-passed-from-Global-Variable/m-p/2230355#M21006</link>
      <description>&lt;P&gt;Consider a SOQL (or SQL) query as a string.&lt;BR /&gt;This string can be a constant such as "SELECT myField FROM myObject" or it may have variable parts for the condition.&lt;BR /&gt;Start by thinking what the request should look like, for example "SELECT myField FROM myObject WHERE myField = 'AAA'".&lt;BR /&gt;Here "AAA" is not fixed but is included into a global variable (let say myGlobal).&lt;BR /&gt;So, you need to construct the request with a fixed part, completed with the content of a global variable and an other fixed part to finish.&lt;BR /&gt;The result should be:&lt;BR /&gt;"SELECT myField FROM myObject WHERE myField = '" + (String)globalMap.get("myGlobal") + "'"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pay attention at the&amp;nbsp;globalMap.get syntax, the variable name is a constant "myGlobal" or contained into an other variable (&lt;SPAN&gt;Country2 for example in your case) which must be known to be used.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 13:16:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-value-being-passed-from-Global-Variable/m-p/2230355#M21006</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2020-06-24T13:16:30Z</dc:date>
    </item>
  </channel>
</rss>

