<?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 Nested LOAD in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Nested-LOAD/m-p/235468#M86724</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;P&gt;It is possible to use a Nested LOAD, like we do with SQL ??&lt;/P&gt;&lt;P&gt;Here's a example:&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;LOAD field1,&lt;/P&gt;&lt;P&gt;field2,&lt;/P&gt;&lt;P&gt;periodo&lt;/P&gt;&lt;P&gt;FROM table1.qvd (qvd)&lt;/P&gt;&lt;P&gt;WHERE Month(Periodo) = (LOAD RangeMax(Month(Periodo)) FROM Table2.qvd (qvd))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried that, and didn't work.&lt;/P&gt;&lt;P&gt;Any ideas how to solve that ? Or there's a way to save the result of (LOAD RangeMax(Month(Periodo)) FROM Table2.qvd (qvd))&lt;/P&gt;&lt;P&gt;in a variable, and use it in the Where clause ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Apr 2011 14:09:16 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-04-29T14:09:16Z</dc:date>
    <item>
      <title>Nested LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-LOAD/m-p/235468#M86724</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;P&gt;It is possible to use a Nested LOAD, like we do with SQL ??&lt;/P&gt;&lt;P&gt;Here's a example:&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;LOAD field1,&lt;/P&gt;&lt;P&gt;field2,&lt;/P&gt;&lt;P&gt;periodo&lt;/P&gt;&lt;P&gt;FROM table1.qvd (qvd)&lt;/P&gt;&lt;P&gt;WHERE Month(Periodo) = (LOAD RangeMax(Month(Periodo)) FROM Table2.qvd (qvd))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried that, and didn't work.&lt;/P&gt;&lt;P&gt;Any ideas how to solve that ? Or there's a way to save the result of (LOAD RangeMax(Month(Periodo)) FROM Table2.qvd (qvd))&lt;/P&gt;&lt;P&gt;in a variable, and use it in the Where clause ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 14:09:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-LOAD/m-p/235468#M86724</guid>
      <dc:creator />
      <dc:date>2011-04-29T14:09:16Z</dc:date>
    </item>
    <item>
      <title>Nested LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-LOAD/m-p/235469#M86725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;try this code&lt;/P&gt;&lt;P&gt;Table2:&lt;BR /&gt;load&lt;BR /&gt; Periodo&lt;BR /&gt;from table2.qvd (qvd);&lt;/P&gt;&lt;P&gt;findMaxMonth:&lt;BR /&gt;load Max(Month(Periodo)) as MaxMonth&lt;BR /&gt;resident Table2;&lt;/P&gt;&lt;P&gt;let varMaxMonth=peek('MaxMonth',-1,findMaxMonth);&lt;/P&gt;&lt;P&gt;drop table findMaxMonth;&lt;/P&gt;&lt;P&gt;Table1:&lt;BR /&gt;LOAD field1,&lt;BR /&gt; field2,&lt;BR /&gt; periodo&lt;BR /&gt;FROM table1.qvd (qvd)&lt;BR /&gt;WHERE num(Month(Periodo)) = $(varMaxMonth) FROM Table2.qvd (qvd))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 14:18:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-LOAD/m-p/235469#M86725</guid>
      <dc:creator>pat_agen</dc:creator>
      <dc:date>2011-04-29T14:18:09Z</dc:date>
    </item>
    <item>
      <title>Nested LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-LOAD/m-p/235470#M86726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Josué,&lt;/P&gt;&lt;P&gt;I think that there are several ways to accomplish this, but, in my opinion, the simplest is to load your max month into a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like so:&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;LOAD RangeMax(Month(Periodo)) AS maxmonth FROM Table2.qvd (qvd);&lt;BR /&gt;&lt;BR /&gt;LET vMaxMonth = FIELDVALUE('maxmonth',1);&lt;BR /&gt;&lt;BR /&gt;DROP TABLE tmp;&lt;BR /&gt;&lt;BR /&gt;Table1:&lt;BR /&gt;LOAD&lt;BR style="padding-left:30px;" /&gt;field1,&lt;BR style="padding-left:30px;" /&gt;field2,&lt;BR style="padding-left:30px;" /&gt;periodo&lt;BR /&gt;FROM&lt;BR style="padding-left:30px;" /&gt;table1.qvd (qvd)&lt;BR /&gt;WHERE (&lt;BR style="padding-left:30px;" /&gt;MONTH(periodo) = $(vMaxMonth)&lt;BR /&gt;);&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't tested that, but I've used similar load statements. Hopefully this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 14:24:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-LOAD/m-p/235470#M86726</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-04-29T14:24:01Z</dc:date>
    </item>
    <item>
      <title>SV:Re: Nested LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-LOAD/m-p/235471#M86727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think a joined load would be a bit cleaner, since you dont have to create variables or drop tables.&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;// Randomized test data&lt;BR /&gt;&lt;BR /&gt;Data:&lt;BR /&gt;Load&lt;BR /&gt;Ceil(Rand()*10) as ID,&lt;BR /&gt;RecNo() as Value&lt;BR /&gt;autogenerate 20;&lt;BR /&gt;&lt;BR /&gt;Result:&lt;BR /&gt;&lt;BR /&gt;//Load max value by sorting in descending order, and only include first record&lt;BR /&gt;LOAD&lt;BR /&gt;ID as ResultID&lt;BR /&gt;Resident Data&lt;BR /&gt;Where RecNo() = 1&lt;BR /&gt;Order By ID desc;&lt;BR /&gt;&lt;BR /&gt;//Load the data table with an inner join to only include the max value related rows&lt;BR /&gt;Inner Join&lt;BR /&gt;LOAD&lt;BR /&gt;ID as ResultID,&lt;BR /&gt;Value as ResultValue&lt;BR /&gt;Resident Data;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 15:55:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-LOAD/m-p/235471#M86727</guid>
      <dc:creator>ToniKautto</dc:creator>
      <dc:date>2011-04-29T15:55:37Z</dc:date>
    </item>
    <item>
      <title>Nested LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-LOAD/m-p/235472#M86728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Josué, in my experience joining and where statement can be slower than keep syntaxis when working with millions of records, so you may try this:&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;LOAD field1,&lt;/P&gt;&lt;P&gt;field2,&lt;/P&gt;&lt;P&gt;periodo&lt;/P&gt;&lt;P&gt;FROM table1.qvd (qvd)&lt;/P&gt;&lt;P&gt;Table2:&lt;BR /&gt;right keep(Table1)&lt;/P&gt;&lt;P&gt;load&lt;BR /&gt; max(Periodo) as Periodo&lt;BR /&gt;from table2.qvd (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Table2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 16:15:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-LOAD/m-p/235472#M86728</guid>
      <dc:creator />
      <dc:date>2011-04-29T16:15:41Z</dc:date>
    </item>
    <item>
      <title>Nested LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-LOAD/m-p/235473#M86729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because I have to use this filter in many other tables, I used the variable solution, and worked fine.&lt;/P&gt;&lt;P&gt;The Join solution I'll try later.&lt;/P&gt;&lt;P&gt;Thank you all guys, this forum is saving me a lot of time !!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 20:58:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-LOAD/m-p/235473#M86729</guid>
      <dc:creator />
      <dc:date>2011-04-29T20:58:46Z</dc:date>
    </item>
  </channel>
</rss>

