<?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 Re: For Next Loop Dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/For-Next-Loop-Dates/m-p/1282245#M401996</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Assign variables for start date and end date.&lt;/P&gt;&lt;P&gt;let vEndDate=num(today());&lt;/P&gt;&lt;P&gt;let vStartDate=num(date('2015-09-1'));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Assign variable for number of days between start and end dates.&lt;/P&gt;&lt;P&gt;Let DayCount =$(vEndDate)+1-$(vStartDate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Make table of every date between start and end date.&lt;/P&gt;&lt;P&gt;DateFilters:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;date($(vEndDate)+1-recno(),'YYYY-MM-DD') AS %Dates&lt;/P&gt;&lt;P&gt;AUTOGENERATE $(DayCount);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET NumRows=FieldValueCo&lt;SPAN style="color: #575757;"&gt;unt('&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;%Dates&lt;/SPAN&gt;');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=1 to NumRows&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;LET vDate = peek('%Dates',$(i)-1,'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;DateFilters&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;load *&lt;/P&gt;&lt;P&gt;from YourTable&lt;/P&gt;&lt;P&gt;where StartDate=$(vDate) and EndDate=$(vDate)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;Next;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jan 2017 20:32:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-01-19T20:32:29Z</dc:date>
    <item>
      <title>For Next Loop Dates</title>
      <link>https://community.qlik.com/t5/QlikView/For-Next-Loop-Dates/m-p/1282244#M401995</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;I have a Load statement like the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;From&lt;/P&gt;&lt;P&gt;Connnectionstartdate&lt;STRONG&gt;2017-01-19&lt;/STRONG&gt;enddate&lt;STRONG&gt;2017-01-19&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to run this same load for all dates between 2015-09-01 and today.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot simply change start date to 2015-09-01 and end date to 2017-01-19. This would give me a undesidered result. What i need to do is make a For next loop for every date between this range. the variable used in this loop would be place in the where 2017-01-19 is in the load script above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know of any solutions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Jimmy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 20:08:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Next-Loop-Dates/m-p/1282244#M401995</guid>
      <dc:creator>jeckstein</dc:creator>
      <dc:date>2017-01-19T20:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: For Next Loop Dates</title>
      <link>https://community.qlik.com/t5/QlikView/For-Next-Loop-Dates/m-p/1282245#M401996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Assign variables for start date and end date.&lt;/P&gt;&lt;P&gt;let vEndDate=num(today());&lt;/P&gt;&lt;P&gt;let vStartDate=num(date('2015-09-1'));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Assign variable for number of days between start and end dates.&lt;/P&gt;&lt;P&gt;Let DayCount =$(vEndDate)+1-$(vStartDate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Make table of every date between start and end date.&lt;/P&gt;&lt;P&gt;DateFilters:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;date($(vEndDate)+1-recno(),'YYYY-MM-DD') AS %Dates&lt;/P&gt;&lt;P&gt;AUTOGENERATE $(DayCount);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET NumRows=FieldValueCo&lt;SPAN style="color: #575757;"&gt;unt('&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;%Dates&lt;/SPAN&gt;');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=1 to NumRows&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;LET vDate = peek('%Dates',$(i)-1,'&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;DateFilters&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;load *&lt;/P&gt;&lt;P&gt;from YourTable&lt;/P&gt;&lt;P&gt;where StartDate=$(vDate) and EndDate=$(vDate)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;Next;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 20:32:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Next-Loop-Dates/m-p/1282245#M401996</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-19T20:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: For Next Loop Dates</title>
      <link>https://community.qlik.com/t5/QlikView/For-Next-Loop-Dates/m-p/1282246#M401997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;LET a=date#('2015-09-01', 'YYYY-MM-DD');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Do while a &amp;lt; today()&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; a1 = date(a, 'YYYY-MM-DD');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; trace $(a1);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; // add your load here using a1 variable&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; LET a=a+1;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;loop&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 20:41:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Next-Loop-Dates/m-p/1282246#M401997</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2017-01-19T20:41:25Z</dc:date>
    </item>
  </channel>
</rss>

