<?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 Get Values In HashMap Using globalMap.get() in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-To-Get-Values-In-HashMap-Using-globalMap-get/m-p/2255176#M37963</link>
    <description>You should build the "inString" in the 1st part instead of store indivual values of row5.name in a hashmap or you need to extract values one by one and concatenate them with ' and , to build a valid SQL string before to use it.&lt;BR /&gt;</description>
    <pubDate>Fri, 05 May 2017 18:58:24 GMT</pubDate>
    <dc:creator>TRF</dc:creator>
    <dc:date>2017-05-05T18:58:24Z</dc:date>
    <item>
      <title>How To Get Values In HashMap Using globalMap.get()</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-To-Get-Values-In-HashMap-Using-globalMap-get/m-p/2255172#M37959</link>
      <description>&lt;P&gt;Hi, my scenario is like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Map&amp;lt;String, HashSet&amp;lt;String&amp;gt;&amp;gt; B&amp;nbsp;= new HashMap&amp;lt;String, HashSet&amp;lt;String&amp;gt;&amp;gt;();&lt;/P&gt;&lt;P&gt;if(!B.containsKey(row5.issue)){&lt;BR /&gt;B.put(row5.issue,new HashSet&amp;lt;String&amp;gt;());&lt;BR /&gt;}&lt;BR /&gt;B.get(row5.issue).add(row5.name);&lt;/P&gt;&lt;P&gt;globalMap.put("BMap", B);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I have the following scripts in another Subjob:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select * from Table&lt;/P&gt;&lt;P&gt;where name in &lt;STRONG&gt;('"+BMap.values()+"')&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The bold portion has problems, anyone can advise? Thanks very much.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 09:49:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-To-Get-Values-In-HashMap-Using-globalMap-get/m-p/2255172#M37959</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T09:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: How To Get Values In HashMap Using globalMap.get()</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-To-Get-Values-In-HashMap-Using-globalMap-get/m-p/2255173#M37960</link>
      <description>You can't reference globalMap variables directly. You have to retrieve them, casting them to the appropriate data type. Ex:
&lt;BR /&gt;(String)globalMap.get("exampleVariable")</description>
      <pubDate>Fri, 05 May 2017 15:32:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-To-Get-Values-In-HashMap-Using-globalMap-get/m-p/2255173#M37960</guid>
      <dc:creator>cterenzi</dc:creator>
      <dc:date>2017-05-05T15:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: How To Get Values In HashMap Using globalMap.get()</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-To-Get-Values-In-HashMap-Using-globalMap-get/m-p/2255174#M37961</link>
      <description>&lt;P&gt;Thanks for the reply!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what my scripts look like:&lt;/P&gt;
&lt;P&gt;where name&amp;nbsp;in ('"+((String)globalMap.get("BMap.values()"))+"');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But that can't go through. Thanks again for your reply!&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 15:34:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-To-Get-Values-In-HashMap-Using-globalMap-get/m-p/2255174#M37961</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-05T15:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: How To Get Values In HashMap Using globalMap.get()</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-To-Get-Values-In-HashMap-Using-globalMap-get/m-p/2255175#M37962</link>
      <description>&lt;P&gt;Can anyone please advise? Appreciate your help!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 15:47:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-To-Get-Values-In-HashMap-Using-globalMap-get/m-p/2255175#M37962</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-05T15:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: How To Get Values In HashMap Using globalMap.get()</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-To-Get-Values-In-HashMap-Using-globalMap-get/m-p/2255176#M37963</link>
      <description>You should build the "inString" in the 1st part instead of store indivual values of row5.name in a hashmap or you need to extract values one by one and concatenate them with ' and , to build a valid SQL string before to use it.&lt;BR /&gt;</description>
      <pubDate>Fri, 05 May 2017 18:58:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-To-Get-Values-In-HashMap-Using-globalMap-get/m-p/2255176#M37963</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-05-05T18:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: How To Get Values In HashMap Using globalMap.get()</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-To-Get-Values-In-HashMap-Using-globalMap-get/m-p/2255177#M37964</link>
      <description>You need to "get" BMap before you can act on it.
&lt;BR /&gt;e.g.
&lt;BR /&gt;((HashMap)globalMap.get("BMap")).values()
&lt;BR /&gt;
&lt;BR /&gt;As 
&lt;A href="https://community.qlik.com/s/profile/0053p000007LKj7AAG"&gt;@TRF&lt;/A&gt; noted, the values method does not return a String that you can drop in to your SQL statement. With your current implementation, you'll need to iterate over the Collection it returns and build a String to include in your where clause.
&lt;BR /&gt;
&lt;BR /&gt;If this is the only use of the HashMap in your project, you may want to consider a different approach.</description>
      <pubDate>Fri, 05 May 2017 19:07:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-To-Get-Values-In-HashMap-Using-globalMap-get/m-p/2255177#M37964</guid>
      <dc:creator>cterenzi</dc:creator>
      <dc:date>2017-05-05T19:07:56Z</dc:date>
    </item>
  </channel>
</rss>

