<?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 Load SQL result into variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-SQL-result-into-variable/m-p/208000#M1208436</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, here's an example how I use peek for a similar task:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;PARTS_date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;B&gt;First&lt;/B&gt; 1&lt;BR /&gt;&lt;B&gt;LOAD&lt;/B&gt; date#(left(@1,10),'MM-DD-YYYY') &lt;B&gt;as&lt;/B&gt; UpdateDate&lt;BR /&gt;&lt;B&gt;FROM&lt;/B&gt; &lt;B&gt;&lt;I&gt;[$(File)]&lt;/I&gt;&lt;/B&gt; (biff, no labels, table is [Sheet1$])&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;LET&lt;/P&gt;vCurrFileDate = num(date(peek('UpdateDate',0,'PARTS_date'))); &lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;vCurrFileDate = num(date(peek('UpdateDate',0,'PARTS_date'))); &lt;P&gt;&lt;/P&gt;vCurrFileDate = num(date(peek('UpdateDate',0,'PARTS_date'))); &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jan 2010 14:29:11 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-01-11T14:29:11Z</dc:date>
    <item>
      <title>Load SQL result into variable</title>
      <link>https://community.qlik.com/t5/QlikView/Load-SQL-result-into-variable/m-p/207997#M1208433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Is it possible to load a single field SQL result into a Qlikview variable and use this variable in another SQL load.&lt;BR /&gt;e.g.&lt;BR /&gt;variable = Select foo from table:&lt;BR /&gt;Select baa from table where baa &amp;lt; $(variable)&lt;/P&gt;&lt;P&gt;If it's possible, please tell me the right syntax.&lt;/P&gt;&lt;P&gt;thx in advance&lt;/P&gt;&lt;P&gt;Tom (Newbee)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2010 15:24:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-SQL-result-into-variable/m-p/207997#M1208433</guid>
      <dc:creator />
      <dc:date>2010-01-08T15:24:00Z</dc:date>
    </item>
    <item>
      <title>Load SQL result into variable</title>
      <link>https://community.qlik.com/t5/QlikView/Load-SQL-result-into-variable/m-p/207998#M1208434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, based in your example the script must be something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;tmp:&lt;BR /&gt;Select foo from table;&lt;BR /&gt;&lt;BR /&gt;let variable = peek('foo',0,'tmp');&lt;BR /&gt;drop table tmp;&lt;BR /&gt;&lt;BR /&gt;DATA:&lt;BR /&gt;Select baa from table where baa &amp;lt; $(variable);&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;rgds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2010 16:24:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-SQL-result-into-variable/m-p/207998#M1208434</guid>
      <dc:creator>hector</dc:creator>
      <dc:date>2010-01-08T16:24:16Z</dc:date>
    </item>
    <item>
      <title>Load SQL result into variable</title>
      <link>https://community.qlik.com/t5/QlikView/Load-SQL-result-into-variable/m-p/207999#M1208435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hector, thx&lt;/P&gt;&lt;P&gt;for some reason I don't understand, the function peek doesn't work. Maybe my example describes not my real need. I need a limitation of selected rows by a value of another table.&lt;BR /&gt;But I got a result with function Fieldvalue.&lt;/P&gt;&lt;P&gt;So the Syntax is&lt;/P&gt;&lt;P&gt;Select foo from table1;&lt;BR /&gt;let variable = FiledValue(foo,1);&lt;/P&gt;&lt;P&gt;Select baa from table2 LIMIT $(variable);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jan 2010 13:11:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-SQL-result-into-variable/m-p/207999#M1208435</guid>
      <dc:creator />
      <dc:date>2010-01-11T13:11:30Z</dc:date>
    </item>
    <item>
      <title>Load SQL result into variable</title>
      <link>https://community.qlik.com/t5/QlikView/Load-SQL-result-into-variable/m-p/208000#M1208436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, here's an example how I use peek for a similar task:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;PARTS_date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;B&gt;First&lt;/B&gt; 1&lt;BR /&gt;&lt;B&gt;LOAD&lt;/B&gt; date#(left(@1,10),'MM-DD-YYYY') &lt;B&gt;as&lt;/B&gt; UpdateDate&lt;BR /&gt;&lt;B&gt;FROM&lt;/B&gt; &lt;B&gt;&lt;I&gt;[$(File)]&lt;/I&gt;&lt;/B&gt; (biff, no labels, table is [Sheet1$])&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;LET&lt;/P&gt;vCurrFileDate = num(date(peek('UpdateDate',0,'PARTS_date'))); &lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;vCurrFileDate = num(date(peek('UpdateDate',0,'PARTS_date'))); &lt;P&gt;&lt;/P&gt;vCurrFileDate = num(date(peek('UpdateDate',0,'PARTS_date'))); &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jan 2010 14:29:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-SQL-result-into-variable/m-p/208000#M1208436</guid>
      <dc:creator />
      <dc:date>2010-01-11T14:29:11Z</dc:date>
    </item>
  </channel>
</rss>

