<?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: Create a string variable that can be used in WHERE clause from other tables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-a-string-variable-that-can-be-used-in-WHERE-clause-from/m-p/129727#M510207</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Create a temporary table&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;tmp:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NoConcatenate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load Concat(DISTINCT&lt;SPAN style="color: #ff0000;"&gt; Chr(39) &amp;amp;&lt;/SPAN&gt; item_no &lt;SPAN style="color: #ff0000;"&gt;&amp;amp; Chr(39)&lt;/SPAN&gt;,',') as FieldA&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident &amp;lt;TABLE&amp;gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vSKU = peek('FieldA',0,'tmp');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;DROP Table tmp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Aug 2018 17:59:27 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-08-10T17:59:27Z</dc:date>
    <item>
      <title>Create a string variable that can be used in WHERE clause from other tables</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-string-variable-that-can-be-used-in-WHERE-clause-from/m-p/129726#M510206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Community!&lt;/P&gt;&lt;P&gt;This is probably an easy one for this group, but I'm struggling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a list of items that I have assign to a variable in my load script.&amp;nbsp; My plan is to use this list of items in the WHERE clause of other tables to limit the data that I'm returning so that I only return the items assigned to my variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is how I'm building my variable string:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/161801"&gt;Load holiday list into variable in script&lt;/A&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;// Create a temporary table&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM style="font-size: 13.3333px;"&gt;tmp:&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM style="font-size: 13.3333px;"&gt;NoConcatenate&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM style="font-size: 13.3333px;"&gt;Load concat(Distinct item_no,',') as FieldA&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM style="font-size: 13.3333px;"&gt;Resident &amp;lt;TABLE&amp;gt;;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM style="font-size: 13.3333px;"&gt;let vSKU = peek('FieldA',0,'tmp');&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;drop table tmp;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is yielding values like this: &lt;STRONG&gt;vSKU = ABCD-123,ABCF-456,ABFG-321&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I load my next table and try to use a WHERE clause that performs a MATCH(item_no_2,'$(vSKU)') &amp;gt; 0 I'm getting no results. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based upon my testing, I know that I need to wrap my item numbers with a single quote (') so that they look like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; vSKU =&amp;nbsp; 'ABCD-123','ABCF-456','ABFG-321'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What function and I missing or misusing that will help me do this? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 17:49:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-string-variable-that-can-be-used-in-WHERE-clause-from/m-p/129726#M510206</guid>
      <dc:creator>kevin_creese</dc:creator>
      <dc:date>2018-08-10T17:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create a string variable that can be used in WHERE clause from other tables</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-string-variable-that-can-be-used-in-WHERE-clause-from/m-p/129727#M510207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Create a temporary table&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;tmp:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NoConcatenate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load Concat(DISTINCT&lt;SPAN style="color: #ff0000;"&gt; Chr(39) &amp;amp;&lt;/SPAN&gt; item_no &lt;SPAN style="color: #ff0000;"&gt;&amp;amp; Chr(39)&lt;/SPAN&gt;,',') as FieldA&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident &amp;lt;TABLE&amp;gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vSKU = peek('FieldA',0,'tmp');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;DROP Table tmp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 17:59:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-string-variable-that-can-be-used-in-WHERE-clause-from/m-p/129727#M510207</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-08-10T17:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Create a string variable that can be used in WHERE clause from other tables</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-string-variable-that-can-be-used-in-WHERE-clause-from/m-p/129728#M510208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try below?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-size: 13.3333px; font-family: inherit;"&gt;tmp:&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-size: 13.3333px; font-family: inherit;"&gt;NoConcatenate&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-size: 13.3333px; font-family: inherit;"&gt;Load concat(&lt;EM style="color: #3d3d3d; font-family: inherit; font-weight: inherit; font-size: 13.3333px;"&gt;Distinct&amp;nbsp; &lt;/EM&gt;&lt;STRONG style="color: #ff6600;"&gt;Chr(39)&lt;/STRONG&gt;&amp;amp;item_no&lt;STRONG style="color: #ff6600;"&gt;&amp;amp;Chr(39)&lt;/STRONG&gt;,',') as FieldA&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-size: 13.3333px; font-family: inherit;"&gt;Resident &amp;lt;TABLE&amp;gt;;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-size: 13.3333px; font-family: inherit;"&gt;let vSKU = peek('FieldA',0,'tmp');&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-size: 13.3333px; font-family: inherit;"&gt;drop table tmp;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Then try like without Quotes.&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="padding: 0 0 0 30px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;WHERE Match(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;item_no_2, &lt;STRONG style="color: #ff6600;"&gt;$(vSKU)&lt;/STRONG&gt;) &amp;gt; 0 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 18:06:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-string-variable-that-can-be-used-in-WHERE-clause-from/m-p/129728#M510208</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2018-08-10T18:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create a string variable that can be used in WHERE clause from other tables</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-string-variable-that-can-be-used-in-WHERE-clause-from/m-p/129729#M510209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect!&amp;nbsp; I had to modify my MATCH to &lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;MATCH(item_no_2,$(vSKU)) &amp;gt; 0 and then the stars aligned and I can get on with this project!&amp;nbsp; Thanks Sunny! &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 18:08:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-string-variable-that-can-be-used-in-WHERE-clause-from/m-p/129729#M510209</guid>
      <dc:creator>kevin_creese</dc:creator>
      <dc:date>2018-08-10T18:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create a string variable that can be used in WHERE clause from other tables</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-string-variable-that-can-be-used-in-WHERE-clause-from/m-p/129730#M510210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Super awesome!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 18:09:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-string-variable-that-can-be-used-in-WHERE-clause-from/m-p/129730#M510210</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-08-10T18:09:02Z</dc:date>
    </item>
  </channel>
</rss>

