<?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 Trying to replicate the &amp;quot;WHERE IN&amp;quot; function using QVD's in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Trying-to-replicate-the-quot-WHERE-IN-quot-function-using-QVD-s/m-p/957503#M971252</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to replicated "WHERE IN" from SQL Select but this time using QVD's .Let me know if am doing wrong.. any help is appreciated..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; 1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CT_EMPLOYEE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// EMPLID AS EMPLID_HIST, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;EMPLID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// USERTYPE, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;NAME&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt; &lt;BR /&gt; //&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;ApplyMap&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('JOBSH2LGCOUNTRY',&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;UH_COUNTRY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;COUNTRY&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vQVDDirectory)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;\CORE_USERS_HISTORY.qvd (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;qvd&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&lt;BR /&gt;&lt;SPAN style="color: #008000;"&gt;WHERE EMPLID = (SELECT EMPLID FROM $(vQVDDirectory)\USERS.qvd (qvd) WHERE C_COUNTRY = 'SGP' and USERTYPE = 'E'); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;I have an error "&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;####&lt;/P&gt;&lt;P&gt;Garbage after statement&lt;/P&gt;&lt;P&gt;INNER JOIN &lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp; distinct&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#####&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Sep 2015 20:18:09 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-09-15T20:18:09Z</dc:date>
    <item>
      <title>Trying to replicate the "WHERE IN" function using QVD's</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-replicate-the-quot-WHERE-IN-quot-function-using-QVD-s/m-p/957503#M971252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to replicated "WHERE IN" from SQL Select but this time using QVD's .Let me know if am doing wrong.. any help is appreciated..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; 1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CT_EMPLOYEE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// EMPLID AS EMPLID_HIST, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;EMPLID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// USERTYPE, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;NAME&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt; &lt;BR /&gt; //&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;ApplyMap&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('JOBSH2LGCOUNTRY',&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;UH_COUNTRY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;COUNTRY&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vQVDDirectory)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;\CORE_USERS_HISTORY.qvd (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;qvd&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&lt;BR /&gt;&lt;SPAN style="color: #008000;"&gt;WHERE EMPLID = (SELECT EMPLID FROM $(vQVDDirectory)\USERS.qvd (qvd) WHERE C_COUNTRY = 'SGP' and USERTYPE = 'E'); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;I have an error "&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;####&lt;/P&gt;&lt;P&gt;Garbage after statement&lt;/P&gt;&lt;P&gt;INNER JOIN &lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp; distinct&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#####&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 20:18:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-replicate-the-quot-WHERE-IN-quot-function-using-QVD-s/m-p/957503#M971252</guid>
      <dc:creator />
      <dc:date>2015-09-15T20:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to replicate the "WHERE IN" function using QVD's</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-replicate-the-quot-WHERE-IN-quot-function-using-QVD-s/m-p/957504#M971253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there.&amp;nbsp; WHERE IN clauses are really useful in SQL.&amp;nbsp; One of the best ways to do it uses the EXISTS statement and performs really quickly.&amp;nbsp; To do it you need to load your USERS.qvd first.&amp;nbsp; Here is the approach:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//== LOAD LIST OF EMPLIDs === &lt;/P&gt;&lt;P&gt;Temp_table_01:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt; EMPLID&lt;/P&gt;&lt;P&gt;FROM $(vQVDDirectory)\USERS.qvd (qvd)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//== LOAD PRIMARY DATA ===&lt;/P&gt;&lt;P&gt;USER_HISTORY:&lt;/P&gt;&lt;P&gt;LOAD DISTINCT&lt;/P&gt;&lt;P&gt;1 as CT_EMPLOYEE,&lt;/P&gt;&lt;P&gt;// EMPLID AS EMPLID_HIST, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; EMPLID, &lt;/P&gt;&lt;P&gt;// USERTYPE, &lt;/P&gt;&lt;P&gt;&amp;nbsp; NAME &lt;/P&gt;&lt;P&gt;//&amp;nbsp; ApplyMap('JOBSH2LGCOUNTRY',UH_COUNTRY) as COUNTRY&lt;/P&gt;&lt;P&gt;FROM $(vQVDDirectory)\CORE_USERS_HISTORY.qvd (qvd)&lt;/P&gt;&lt;P&gt;WHERE EXISTS(EMPLID)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE Temp_table_01;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Notes:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; In the first LOAD statement I did not use a DISTINCT keyword - adding a DISTINCT would force it to load 'non-optimized' - much slower.... and it has no negative impact on the subsequent EXISTS statement&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; The EXISTS statement usually allows the LOAD to proceed using the 'optimized' (fastest) method.&amp;nbsp; As opposed to using a JOIN or APPLYMAP which will slow down the load.&amp;nbsp; Using EXISTS isn't always the fastest approach, in certain situations APPLYMAP can be faster overall.&amp;nbsp; Usually a join is the slowest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2015 22:05:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-replicate-the-quot-WHERE-IN-quot-function-using-QVD-s/m-p/957504#M971253</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-09-16T22:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to replicate the "WHERE IN" function using QVD's</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-replicate-the-quot-WHERE-IN-quot-function-using-QVD-s/m-p/957505#M971254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help John..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;forgive my ignorance..It might be a dump question.. trying to understand the binary reference here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How does the USER_HISTORY will know to reference Temp_table_01 EMPLID? because the user_history also has emplid ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope I am making sense ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2015 22:17:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-replicate-the-quot-WHERE-IN-quot-function-using-QVD-s/m-p/957505#M971254</guid>
      <dc:creator />
      <dc:date>2015-09-16T22:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to replicate the "WHERE IN" function using QVD's</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-replicate-the-quot-WHERE-IN-quot-function-using-QVD-s/m-p/957506#M971255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thats a great question.&amp;nbsp; The EXISTS statement looks across all fields loaded thus far, finds other previously load fields with the same exact field name and searches their contents.&amp;nbsp; Unlike a relational database it uses Qlikview's associative model that assumes that any two or more identically named fields should contain the same type of content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, if the field in the table you are loading and seeking to filter using EXISTS is named differently - even if you are renaming it using 'AS' you need to complete the exists statement like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;SpecialDate as Date&lt;/P&gt;&lt;P&gt;FROM XYZ.qvd (qvd)&lt;/P&gt;&lt;P&gt;WHERE EXISTS(Date,&lt;SPAN style="font-size: 13.3333px;"&gt;SpecialDate)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this example, 'Date' has been loaded previous to this load and you are bringing in 'SpecialDate' and renaming it 'Date'... The EXISTS function executes prior to the renaming of the field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2015 22:30:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-replicate-the-quot-WHERE-IN-quot-function-using-QVD-s/m-p/957506#M971255</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-09-16T22:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to replicate the "WHERE IN" function using QVD's</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-replicate-the-quot-WHERE-IN-quot-function-using-QVD-s/m-p/957507#M971256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the time taken to explain it. My understanding is. If the field name matches from the previous table the EXISTS function reference the previous table loaded table name(s).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2015 23:12:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-replicate-the-quot-WHERE-IN-quot-function-using-QVD-s/m-p/957507#M971256</guid>
      <dc:creator />
      <dc:date>2015-09-16T23:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to replicate the "WHERE IN" function using QVD's</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-replicate-the-quot-WHERE-IN-quot-function-using-QVD-s/m-p/957508#M971257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct.&amp;nbsp; If a field has been loaded it will be searched by the Exists() function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Sep 2015 15:52:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-replicate-the-quot-WHERE-IN-quot-function-using-QVD-s/m-p/957508#M971257</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-09-17T15:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to replicate the "WHERE IN" function using QVD's</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-replicate-the-quot-WHERE-IN-quot-function-using-QVD-s/m-p/957509#M971258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;How does the USER_HISTORY will know to reference Temp_table_01 EMPLID? because the user_history also has emplid ...&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It doesn't need to know the table.&lt;/P&gt;&lt;P&gt;It references the field EMPLID.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Sep 2015 22:17:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-replicate-the-quot-WHERE-IN-quot-function-using-QVD-s/m-p/957509#M971258</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-09-17T22:17:42Z</dc:date>
    </item>
  </channel>
</rss>

