<?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: How to pass an array or list as a globalMap variable for a WHERE x IN clause of a DBinput in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-an-array-or-list-as-a-globalMap-variable-for-a-WHERE/m-p/2208325#M7609</link>
    <description>&lt;P&gt;I'm not sure whether you want an Array or whether you simply want to append to a String variable which can be used in your IN in your query. I suspect the String will work better for you given what you have described. Does this sound right? Also, I think it would be better to build the list in a tJavaFlex rather than a tMap. Then you can easily manipulate the list in Java without having to worry about doing it inline.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Mar 2019 12:02:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-03-01T12:02:19Z</dc:date>
    <item>
      <title>How to pass an array or list as a globalMap variable for a WHERE x IN clause of a DBinput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-an-array-or-list-as-a-globalMap-variable-for-a-WHERE/m-p/2208324#M7608</link>
      <description>&lt;P&gt;I'd like to generate a WHERE x IN (a,b,c,...) clause to use in a DBinput querying a very big table.&lt;BR /&gt;the "IN"&amp;nbsp;list is coming from a previous Tmap in my job.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;For now I use a TflowToIterate followed by a Tmap with a reload at each row lookup but it works with a where x=GlobalMap.get("myvar"), thus generating many iteration/ row flow.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Question is how can I generate an array/list from a tmap and use it latter on my job in the IN list of a where clause. i guess globalMap variable is the answer, but i'm struggling on the "how".&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks in advance &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;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 10:46:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-an-array-or-list-as-a-globalMap-variable-for-a-WHERE/m-p/2208324#M7608</guid>
      <dc:creator>Jl-nrd</dc:creator>
      <dc:date>2019-03-01T10:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass an array or list as a globalMap variable for a WHERE x IN clause of a DBinput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-an-array-or-list-as-a-globalMap-variable-for-a-WHERE/m-p/2208325#M7609</link>
      <description>&lt;P&gt;I'm not sure whether you want an Array or whether you simply want to append to a String variable which can be used in your IN in your query. I suspect the String will work better for you given what you have described. Does this sound right? Also, I think it would be better to build the list in a tJavaFlex rather than a tMap. Then you can easily manipulate the list in Java without having to worry about doing it inline.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 12:02:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-an-array-or-list-as-a-globalMap-variable-for-a-WHERE/m-p/2208325#M7609</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-01T12:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass an array or list as a globalMap variable for a WHERE x IN clause of a DBinput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-an-array-or-list-as-a-globalMap-variable-for-a-WHERE/m-p/2208326#M7610</link>
      <description>&lt;P&gt;you could use tjavaflex&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;suppose your input is&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1&lt;/P&gt; 
&lt;P&gt;2&lt;/P&gt; 
&lt;P&gt;3&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;tJavaFlex&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;U&gt;Begin Code&lt;/U&gt;&lt;/P&gt; 
&lt;P&gt;final char COMMA = ',';&lt;BR /&gt;// String builders for Selection Number List .&lt;BR /&gt;StringBuilder selectionListBuilder = new StringBuilder();&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;U&gt;Main Code&lt;/U&gt;&lt;/P&gt; 
&lt;P&gt;// Append comma to the number list.&lt;BR /&gt;if (selectionListBuilder length() != 0) {&lt;BR /&gt;selectionListBuilder.append(COMMA);&lt;BR /&gt;}&lt;BR /&gt;// Append number to selection list.&lt;BR /&gt;selectionListBuilder.append(row1.listelement);&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;U&gt;End Code&amp;nbsp;&lt;/U&gt;&lt;/P&gt; 
&lt;P&gt;// Get the number list.&lt;BR /&gt;String selectionList = selectionListBuilder.toString();&lt;/P&gt; 
&lt;P&gt;&lt;BR /&gt;// Set the global variables.&lt;BR /&gt;if (selectionList length() != 0) {&lt;BR /&gt;globalMap.put("NumberList", selectionList );&lt;BR /&gt;//context.NumberList=selectionList.substring(0,selectionList.length());&lt;BR /&gt;}&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Note that Some database has limit on Number of element in IN clause e.g. Oracle has limit of 1000. So please build your Query expression accordingly.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 14:37:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-an-array-or-list-as-a-globalMap-variable-for-a-WHERE/m-p/2208326#M7610</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2019-03-01T14:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass an array or list as a globalMap variable for a WHERE x IN clause of a DBinput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-pass-an-array-or-list-as-a-globalMap-variable-for-a-WHERE/m-p/2208327#M7611</link>
      <description>&lt;P&gt;Thanks to you 2 you show me the way &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; !&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I've used a tjavarow at the output of my first tMap&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;code :&lt;/P&gt; 
&lt;PRE&gt;if ((String)globalMap.get("inList") == "")
{
globalMap.put("inList", "'"+input_row.elem+"'");
}else{
globalMap.put("inList", (String)globalMap.get("inList")+",'"+ input_row.elem+"'");
}&lt;/PRE&gt; 
&lt;P&gt;After that in the next subjob, on my lookup DBinput of my second tMap i could use WHERE x IN (globalMap.get("inList"))&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 14:46:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-pass-an-array-or-list-as-a-globalMap-variable-for-a-WHERE/m-p/2208327#M7611</guid>
      <dc:creator>Jl-nrd</dc:creator>
      <dc:date>2019-03-01T14:46:16Z</dc:date>
    </item>
  </channel>
</rss>

