<?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 simple QV load statement help please... in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/simple-QV-load-statement-help-please/m-p/213806#M67463</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm guessing this sort of join is what you meant by doing it easily in SQL?&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;First_Business_Days:&lt;BR /&gt;NOCONCATENATE&lt;BR /&gt;LOAD&lt;BR /&gt; bq_date as fb_date&lt;BR /&gt;,rowno() as fb_row_pos&lt;BR /&gt;RESIDENT First_Business_days&lt;BR /&gt;WHERE first_business = -1&lt;BR /&gt;;&lt;BR /&gt;LEFT JOIN (First_Business_Days)&lt;BR /&gt;LOAD&lt;BR /&gt; fb_row_pos - 18 as fb_row_pos&lt;BR /&gt;,fb_date as earlier_date&lt;BR /&gt;RESIDENT First_Business_Days&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;Probably even easier using peek?&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;First_Business_Days:&lt;BR /&gt;NOCONCATENATE&lt;BR /&gt;LOAD&lt;BR /&gt; bq_date as fb_date&lt;BR /&gt;,rowno() as fb_row_pos&lt;BR /&gt;,peek(fb_date,-18) as earlier_date&lt;BR /&gt;RESIDENT First_Business_days&lt;BR /&gt;WHERE first_business = -1&lt;BR /&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Jan 2010 21:34:13 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2010-01-15T21:34:13Z</dc:date>
    <item>
      <title>simple QV load statement help please...</title>
      <link>https://community.qlik.com/t5/QlikView/simple-QV-load-statement-help-please/m-p/213805#M67462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this load:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First_Business_Days:&lt;/P&gt;&lt;P&gt;noconcatenate load bq_date as fb_date, RowNo() as fb_row_pos&lt;/P&gt;&lt;P&gt;resident First_Business_days&lt;/P&gt;&lt;P&gt;where first_business = -1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it ends up with a list of dates (first business days of each week) and the row number in the table&lt;/P&gt;&lt;P&gt;'2009-01-19', 1&lt;/P&gt;&lt;P&gt;'2009-01-26', 2&lt;/P&gt;&lt;P&gt;'2009-02-02', 3&lt;/P&gt;&lt;P&gt;etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need is a result set that has:&lt;/P&gt;&lt;P&gt;date, row number, earlier-date that exists 18 rows up (earlier in the timeline)&lt;/P&gt;&lt;P&gt;so the 20th row would have:&lt;/P&gt;&lt;P&gt;date, 20, {whatever date was at row-number-2}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's easy as hell in SQL, but QV load syntax has me flummoxed&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2010 21:01:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/simple-QV-load-statement-help-please/m-p/213805#M67462</guid>
      <dc:creator />
      <dc:date>2010-01-15T21:01:12Z</dc:date>
    </item>
    <item>
      <title>simple QV load statement help please...</title>
      <link>https://community.qlik.com/t5/QlikView/simple-QV-load-statement-help-please/m-p/213806#M67463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm guessing this sort of join is what you meant by doing it easily in SQL?&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;First_Business_Days:&lt;BR /&gt;NOCONCATENATE&lt;BR /&gt;LOAD&lt;BR /&gt; bq_date as fb_date&lt;BR /&gt;,rowno() as fb_row_pos&lt;BR /&gt;RESIDENT First_Business_days&lt;BR /&gt;WHERE first_business = -1&lt;BR /&gt;;&lt;BR /&gt;LEFT JOIN (First_Business_Days)&lt;BR /&gt;LOAD&lt;BR /&gt; fb_row_pos - 18 as fb_row_pos&lt;BR /&gt;,fb_date as earlier_date&lt;BR /&gt;RESIDENT First_Business_Days&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;Probably even easier using peek?&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;First_Business_Days:&lt;BR /&gt;NOCONCATENATE&lt;BR /&gt;LOAD&lt;BR /&gt; bq_date as fb_date&lt;BR /&gt;,rowno() as fb_row_pos&lt;BR /&gt;,peek(fb_date,-18) as earlier_date&lt;BR /&gt;RESIDENT First_Business_days&lt;BR /&gt;WHERE first_business = -1&lt;BR /&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2010 21:34:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/simple-QV-load-statement-help-please/m-p/213806#M67463</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-01-15T21:34:13Z</dc:date>
    </item>
    <item>
      <title>simple QV load statement help please...</title>
      <link>https://community.qlik.com/t5/QlikView/simple-QV-load-statement-help-please/m-p/213807#M67464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Heh, nice shot John, if I change the - to a + sign, I get the results I want... except for the empty values for the first 18 rows of "earlier_date". ?Is there a way to set them to, say, min(fb_date) or something like it? (I would assume any function like min or max would force me to use a group by, etc...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2010 22:35:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/simple-QV-load-statement-help-please/m-p/213807#M67464</guid>
      <dc:creator />
      <dc:date>2010-01-15T22:35:50Z</dc:date>
    </item>
    <item>
      <title>simple QV load statement help please...</title>
      <link>https://community.qlik.com/t5/QlikView/simple-QV-load-statement-help-please/m-p/213808#M67465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I assumed you wanted null for the first 18 rows. If you want the very first date, '2009-01-19' for your example data, I'm guessing this?&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;First_Business_Days:&lt;BR /&gt;NOCONCATENATE&lt;BR /&gt;LOAD&lt;BR /&gt; bq_date as fb_date&lt;BR /&gt;,rowno() as fb_row_pos&lt;BR /&gt;,if(rowno()= 1, bq_date&lt;BR /&gt;,if(rowno()&amp;lt;19,peek(fb_date,0)&lt;BR /&gt; ,peek(fb_date,-18))) as earlier_date&lt;BR /&gt;RESIDENT First_Business_days&lt;BR /&gt;WHERE first_business = -1&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;I didn't think of any easy way to do it with the join approach, but I wouldn't use the join approach anyway.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2010 22:59:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/simple-QV-load-statement-help-please/m-p/213808#M67465</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-01-15T22:59:04Z</dc:date>
    </item>
    <item>
      <title>simple QV load statement help please...</title>
      <link>https://community.qlik.com/t5/QlikView/simple-QV-load-statement-help-please/m-p/213809#M67466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow, bang on. I need to learn about peek, I think.&lt;/P&gt;&lt;P&gt;Much thanks, John, as usual &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2010 23:39:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/simple-QV-load-statement-help-please/m-p/213809#M67466</guid>
      <dc:creator />
      <dc:date>2010-01-15T23:39:06Z</dc:date>
    </item>
  </channel>
</rss>

