<?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: Data loading with a condition on date in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863719#M71294</link>
    <description>&lt;P&gt;Indeed - I just used that as arbitrary values, though. You can place any two dates you want in the start and end variables.&lt;/P&gt;</description>
    <pubDate>Thu, 25 Nov 2021 15:50:54 GMT</pubDate>
    <dc:creator>Or</dc:creator>
    <dc:date>2021-11-25T15:50:54Z</dc:date>
    <item>
      <title>Data loading with a condition on date</title>
      <link>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863664#M71284</link>
      <description>&lt;P&gt;Hello world,&lt;/P&gt;
&lt;P&gt;I want to load a table for a certain period, I chose April for this example. Since I'm not sure that each date exists, I created a condition to check that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Let vJ_D=DATE#('01/04/2021','DD/MM/YYYY');
Let vJ_F=DATE#('30/04/2021','DD/MM/YYYY');
Let vNbr_Jour=floor(vJ_F - vJ_D)+1;
For j = 1 to vNbr_Jour
NoConcatenate
TABLE:
Load DATE#(Date,'DD/MM/YYYY') as Date
, brand , criteria , assesement 
Resident TAB
Where match(DATE#(Date,'DD/MM/YYYY') , $(vJ_D)+$(j)-1) //
next j;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, the loop for isn't executed. I think this expression $(vJ_D)+$(j)-1 is wrong.How should I change that expression?&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 16:25:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863664#M71284</guid>
      <dc:creator>Nourrahmcnean</dc:creator>
      <dc:date>2021-11-30T16:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Data loading with a condition on date</title>
      <link>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863681#M71285</link>
      <description>&lt;P&gt;This doesn't exactly answer your question, but - why aren't you just loading values that are &amp;gt;= vJ_D and &amp;lt;= vJ_F? That would be both easier and faster than using a loop, generally.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 15:02:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863681#M71285</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-11-25T15:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Data loading with a condition on date</title>
      <link>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863684#M71286</link>
      <description>&lt;P&gt;Because I want to load it for each date then store it in a qvd file. I want to have a qvd file for each date&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 15:04:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863684#M71286</guid>
      <dc:creator>Nourrahmcnean</dc:creator>
      <dc:date>2021-11-25T15:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Data loading with a condition on date</title>
      <link>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863692#M71289</link>
      <description>&lt;P&gt;I see. I suppose that means you do need a loop here...&lt;/P&gt;
&lt;P&gt;Something along the lines of e.g. (Note: This isn't precise syntax but it should give you the right idea):&lt;/P&gt;
&lt;P&gt;Let vStart = today()-30;&lt;/P&gt;
&lt;P&gt;Let vEnd = Today();&lt;/P&gt;
&lt;P&gt;Do while vStart &amp;lt;= vEnd&lt;/P&gt;
&lt;P&gt;YourTable:&lt;/P&gt;
&lt;P&gt;Load Field&lt;/P&gt;
&lt;P&gt;Resident Table1&lt;/P&gt;
&lt;P&gt;Where DateField = '$(vStart)';&lt;/P&gt;
&lt;P&gt;Store YourTable into LocationFile;&lt;/P&gt;
&lt;P&gt;Drop Table YourTable;&lt;/P&gt;
&lt;P&gt;Let vStart = vStart + 1;&lt;/P&gt;
&lt;P&gt;Loop&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 15:17:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863692#M71289</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-11-25T15:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Data loading with a condition on date</title>
      <link>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863705#M71291</link>
      <description>&lt;P&gt;Thanks. Today() gives you the date of the executing the script right?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 15:29:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863705#M71291</guid>
      <dc:creator>Nourrahmcnean</dc:creator>
      <dc:date>2021-11-25T15:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Data loading with a condition on date</title>
      <link>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863719#M71294</link>
      <description>&lt;P&gt;Indeed - I just used that as arbitrary values, though. You can place any two dates you want in the start and end variables.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 15:50:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863719#M71294</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-11-25T15:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Data loading with a condition on date</title>
      <link>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863729#M71296</link>
      <description>&lt;P&gt;Thank you it worked. It's really weird that loop for doesn't do the job.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 16:08:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863729#M71296</guid>
      <dc:creator>Nourrahmcnean</dc:creator>
      <dc:date>2021-11-25T16:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Data loading with a condition on date</title>
      <link>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863734#M71298</link>
      <description>&lt;P&gt;I'm sure your loop could have been adjusted to work, but I have to admit I found it easier to write my own from scratch than to troubleshoot an existing loop. Normally looping through values is easier with Load...While, but in this case since you're storing individual QVD files that isn't an option either.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 16:15:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-loading-with-a-condition-on-date/m-p/1863734#M71298</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-11-25T16:15:13Z</dc:date>
    </item>
  </channel>
</rss>

