<?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 Howto use field-value previously charged in another sql statement in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281220#M1202689</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For what it's worth, LOAD field names before renaming (if any) must match with those retrieved from database, meaning they are case sensitive, meaning is you do&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;select CodeId, date from table;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;You must load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LOAD CodeId, date;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Apart from that, I always do this way as I control any transformation I need to do for QlikView applications and this way I only load those fields I need, regardless the information I'm pulling from the database.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Oct 2010 16:45:17 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2010-10-05T16:45:17Z</dc:date>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281216#M1202685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to use the value of a field previously charged from a table by sql, in the next sql-statement. such as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;select CodeId, date from outTable1 where date = x;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table2:&lt;/P&gt;&lt;P&gt;select CodeId, other from outTable2 ...&lt;/P&gt;&lt;P&gt;and now what I want, use the value of previous Table1.CodeId as selection for table2, sucha as&lt;/P&gt;&lt;P&gt;where outTable2.CodeId in (select, load, exist wathever Table1.CodeId));&lt;/P&gt;&lt;P&gt;I don´t know if I make myself understod.&lt;/P&gt;&lt;P&gt;Supposedly Table1 is now resident, so I should be able to read Table1.CodeId to compare in teh script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haven´t found solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The hint is that outTable2 doesn´t have Date-field, I have to use the key-field CodeId to make an incremental load, of just new records on outTable1 and outTable2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;JuanJo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 11:25:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281216#M1202685</guid>
      <dc:creator />
      <dc:date>2010-10-05T11:25:18Z</dc:date>
    </item>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281217#M1202686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Juanjo,&lt;/P&gt;&lt;P&gt;You can do that using exists()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Table1:LOAD CodeId, date;SQL Select CodeId, date from outTable1 where date = x; table2:LOAD *WHERE EXISTS(CodeId);SQL Select CodeId, other from outTable2 ...&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope that helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 11:43:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281217#M1202686</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-10-05T11:43:50Z</dc:date>
    </item>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281218#M1202687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm give it a try, but before I do. Never seen first load and after select, Thanks, I´ll tell you&lt;/P&gt;&lt;P&gt;JuanJo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 12:50:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281218#M1202687</guid>
      <dc:creator />
      <dc:date>2010-10-05T12:50:13Z</dc:date>
    </item>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281219#M1202688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now, it´s working well, a little slow, but no so much as charging full outTable2.&lt;/P&gt;&lt;P&gt;I have to use&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;load * ;&lt;/P&gt;&lt;P&gt;SQL Select ....&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;Load * where exists(CodeId);&lt;/P&gt;&lt;P&gt;SQL Select ....&lt;/P&gt;&lt;P&gt;If I put fields in Load, doesn´t work, crashes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much, one more step to total "INCREMENTAL" load in my doings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JuanJo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 13:24:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281219#M1202688</guid>
      <dc:creator />
      <dc:date>2010-10-05T13:24:19Z</dc:date>
    </item>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281220#M1202689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For what it's worth, LOAD field names before renaming (if any) must match with those retrieved from database, meaning they are case sensitive, meaning is you do&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;select CodeId, date from table;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;You must load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LOAD CodeId, date;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Apart from that, I always do this way as I control any transformation I need to do for QlikView applications and this way I only load those fields I need, regardless the information I'm pulling from the database.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 16:45:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281220#M1202689</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-10-05T16:45:17Z</dc:date>
    </item>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281221#M1202690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Two approaches might make the load more efficient. First, you can just do the table2 load as a join in the SQL:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;SQL SELECT 2.CodeId, 2.other&lt;BR /&gt;FROM Table1 1, Table2 2&lt;BR /&gt;WHERE 1.date = x&lt;BR /&gt; AND 2.CodeId = 1.CodeId;&lt;/P&gt;&lt;P&gt;Second, you can convert the list of CodeIds from the first table into a variable, and use the variable in the second select. Subject to likely syntax errors, something like this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Temp:&lt;BR /&gt;LOAD concat(CodeId,chr(39)&amp;amp;','&amp;amp;chr(39)) as Codes&lt;BR /&gt;RESIDENT Table1;&lt;BR /&gt;LET vCodes = chr(39) &amp;amp; peek('Codes') &amp;amp; chr(39); // fixed per later posts&lt;BR /&gt;DROP TABLE Temp;&lt;BR /&gt;Table2:&lt;BR /&gt;LOAD *;&lt;BR /&gt;SQL SELECT CodeId, other&lt;BR /&gt;FROM Table2&lt;BR /&gt;WHERE CodeId IN ($(vCodes));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 17:04:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281221#M1202690</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-10-05T17:04:36Z</dc:date>
    </item>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281222#M1202691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much John,&lt;/P&gt;&lt;P&gt;First idea works fine and fast, really fast. Used to solve and charge one by one, I hadn´t visualize doing it so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second idea doesn´t do what we expect, only one register read from resident Table1, and then goes to table2 sql and reads the whole table, which shoudn´t in any case, just what's inside $vCodes.&lt;/P&gt;&lt;P&gt;I wonder what got inside vCodes... ????&lt;/P&gt;&lt;P&gt;Anyway the first solution works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks very much&lt;/P&gt;&lt;P&gt;JuanJo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 08:51:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281222#M1202691</guid>
      <dc:creator />
      <dc:date>2010-10-06T08:51:48Z</dc:date>
    </item>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281223#M1202692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a hint of what happens,&lt;/P&gt;&lt;P&gt;The chain Codes laks of a ' " ' sign at the very beginning, I have let the full work be done, and after loading whole table2, shows me the error or warning CodeId IN (alue1","value2"...) "unknown sentence".&lt;/P&gt;&lt;P&gt;Anyway it shouldn't load, and crash at the IN sentence. But vCodes get all values right, less teh " sign at the begining.&lt;/P&gt;&lt;P&gt;I don't like unsolved problems, so that's why I'm digging on it. The first solution works fine, but I like the second as elegant, and if it worked, by solving the problem, I'd had one more tool.&lt;/P&gt;&lt;P&gt;Always learning&lt;/P&gt;&lt;P&gt;JuanJo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 09:33:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281223#M1202692</guid>
      <dc:creator />
      <dc:date>2010-10-06T09:33:05Z</dc:date>
    </item>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281224#M1202693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Helo Juanjo,&lt;/P&gt;&lt;P&gt;Just taking John's syntax one step further,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Temp:LOAD concat(CodeId,chr(39)&amp;amp;','&amp;amp;chr(39)) as CodesRESIDENT Table1;LET vCodes = chr(39) &amp;amp; peek('Codes') &amp;amp; chr(39);&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Now, vCodes wil get all values properly quoted.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 10:33:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281224#M1202693</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-10-06T10:33:51Z</dc:date>
    </item>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281225#M1202694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've just tested, and makes the same error, but vCodes is right with its slashes, now yes. But still doesn't work and keeps loading the whole table. Here I would say an improper word. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;strange, should work. Does the in statement have a limit to the size of the list? Does the capacity of a variable has any limitation? Maybe it fails to read the whole variable values.&lt;/P&gt;&lt;P&gt;Again, the problem now is solved with the combined reading of the two tables as A and B, and is fast. I just don't like living things unsolved. green&lt;/P&gt;&lt;P&gt;JuanJo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 12:40:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281225#M1202694</guid>
      <dc:creator />
      <dc:date>2010-10-06T12:40:26Z</dc:date>
    </item>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281226#M1202695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;aJuanJoq wrote:strange, should work. Does the in statement have a limit to the size of the list? Does the capacity of a variable has any limitation? Maybe it fails to read the whole variable values.&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;It depends on your database and odbc driver, but it's likely to be some limitation on the parameters that can be passed in one sentece. Another option would be to set the IN clause in the LOAD part instead of the SQL part. Untested though, it should look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Table2:LOAD * WHERE MATCH(CodeId, $(vCodes)) &amp;gt; 0;SQL SELECT *FROM Table;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I don't think either this as a good solution in terms of performance.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 12:59:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281226#M1202695</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-10-06T12:59:49Z</dc:date>
    </item>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281227#M1202696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all I want to beg your perdon. I had a semicolon after the table and before the where statement of the WHERE IN. Sorry.&lt;/P&gt;&lt;P&gt;But anyway it doesn´t work, now it crashes and doesn't load the whole table which is right.&lt;/P&gt;&lt;P&gt;It may be, not working, because cannot read the whole variable vCodes, when I receive the error, shows me lots of IN('value1','value2','value3'... but not the whole variable value, truncated.&lt;/P&gt;&lt;P&gt;I'm using TransTools engine&lt;/P&gt;&lt;P&gt;JuanJo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 13:53:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281227#M1202696</guid>
      <dc:creator />
      <dc:date>2010-10-06T13:53:30Z</dc:date>
    </item>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281228#M1202697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;and Miguel, your last offer doesn't work. freezes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 13:54:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281228#M1202697</guid>
      <dc:creator />
      <dc:date>2010-10-06T13:54:51Z</dc:date>
    </item>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281229#M1202698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your guess that it isn't passing the whole thing to the database sounds reasonable. In that case, there's no way around it that I'm thinking of. Miguel's version moving the match to the load will just reintroduce the performance (as he suggests), since you're now reading the whole table again, and only throwing out rows after retrieving them to QlikView. Not sure why it isn't working at all, though.&lt;/P&gt;&lt;P&gt;So perhaps the best option for this specific case is the one you already have working now, with the join in SQL. Just keep the other one in mind for future cases where the list you need to pass is shorter. How short is an open question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 20:58:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281229#M1202698</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-10-06T20:58:56Z</dc:date>
    </item>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281230#M1202699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;John Witherspoon wrote:&lt;BR /&gt;Your guess that it isn't passing the whole thing to the database sounds reasonable. In that case, there's no way around it that I'm thinking of. Miguel's version moving the match to the load will just reintroduce the performance (as he suggests), since you're now reading the whole table again, and only throwing out rows after retrieving them to QlikView. Not sure why it isn't working at all, though.&lt;BR /&gt;So perhaps the best option for this specific case is the one you already have working now, with the join in SQL. Just keep the other one in mind for future cases where the list you need to pass is shorter. How short is an open question. &amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Thanks John, and all others too. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Just want to mention two things. First, as I said above, I had a semicolon, after from table and before where field in($(vCodes), sorry, that's why it was rezadin the whole table, instead of crashing, after that was the error in reading the sentence where field in (...). Anyway, it doesn´t work, once corrected the missmatch.&lt;/P&gt;&lt;P&gt;second, with Miguel's version, all the chr(39) get in place right. But again it doesn't work.&lt;/P&gt;&lt;P&gt;The reason could be that of not being able to read the whole variable. But, sure I will keep this solution in mind in order to try it in other circumstances.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;JuanJo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Oct 2010 07:42:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281230#M1202699</guid>
      <dc:creator />
      <dc:date>2010-10-07T07:42:07Z</dc:date>
    </item>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281231#M1202700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Finally, I got it working, as I was fighting with a variable date, that looked like right but didn´t work. I have found the solution, or why it didn´t work, with the sentence IN....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was the caracter used to delimiter the string to be compared, I must use chr(034)" doble and not chr(039)' simple, because of my database sql.&lt;/P&gt;&lt;P&gt;I have remade the peek('Codes') solution and works just fine, finally..&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;JuanJo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Oct 2010 13:26:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281231#M1202700</guid>
      <dc:creator />
      <dc:date>2010-10-08T13:26:08Z</dc:date>
    </item>
    <item>
      <title>Howto use field-value previously charged in another sql statement in script</title>
      <link>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281232#M1202701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have done the test with less than one day loading, no more tan 20 registers, up to 100 works fine, upper fails to read...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Oct 2010 13:38:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Howto-use-field-value-previously-charged-in-another-sql/m-p/281232#M1202701</guid>
      <dc:creator />
      <dc:date>2010-10-08T13:38:17Z</dc:date>
    </item>
  </channel>
</rss>

