<?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: do while with if statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/do-while-with-if-statement/m-p/1662068#M595246</link>
    <description>&lt;P&gt;if you want to do it with a do while clause then also try this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LET a=year(today())-5;
if num(month(Today()))=1 and num(day(today()))=1 then
do while a&amp;lt;=year(today())-1;

TEST:
Load
*,FileName() as Filename
From
[C:\Users\admin\Desktop\Neuer Ordner (5)\Test_$(a).xlsx]
(ooxml, embedded labels, table is Tabelle1);
Let a=$(a)+1;
loop;

ELSE

do while a&amp;lt;=year(today());
TEST:
Load
*,FileName() as Filename
From
[C:\Users\admin\Desktop\Neuer Ordner (5)\Test_$(a).xlsx]
(ooxml, embedded labels, table is Tabelle1);
Let a=$(a)+1;
Loop
ENDIF;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jan 2020 12:31:31 GMT</pubDate>
    <dc:creator>Frank_Hartmann</dc:creator>
    <dc:date>2020-01-02T12:31:31Z</dc:date>
    <item>
      <title>do while with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/do-while-with-if-statement/m-p/1661958#M595243</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I have a problem with do while and an if statement.&lt;/P&gt;&lt;P&gt;I want to load Data from 5 Years ago to today, but on 01.01. the Data should be load from 5 years ago to year(today)-1, because on 01.01. I haven't Data from the actual year.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;LET a=year(today())-5;&lt;/P&gt;&lt;P&gt;if num(month(Today()))=01 and day(today())=01 then&lt;/P&gt;&lt;P&gt;do while a&amp;lt;=year(today())-1;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;do while a&amp;lt;=year(today());&lt;/P&gt;&lt;P&gt;TEST:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;from TEST_(a).csv;&lt;/P&gt;&lt;P&gt;LET a=a+1;&lt;/P&gt;&lt;P&gt;Loop&lt;/P&gt;&lt;P&gt;ENDIF;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I do this????&lt;/P&gt;&lt;P&gt;Regards Chris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 09:32:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/do-while-with-if-statement/m-p/1661958#M595243</guid>
      <dc:creator>wunderch</dc:creator>
      <dc:date>2020-01-02T09:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: do while with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/do-while-with-if-statement/m-p/1662032#M595244</link>
      <description>&lt;P&gt;Maybe like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if num(month(Today()))=1 and num(day(today()))=1 then
For a = year(today())-5 to year(today())-1;
TEST$(a):
Load
*, FileName() as Filename
FROM
[Test_$(a).csv];
next a;
ELSE
For b = year(today())-5 to year(today())
TEST$(b):
Load
*, FileName() as Filename
FROM
[Test_$(b).csv];
next b;
endif;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 11:25:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/do-while-with-if-statement/m-p/1662032#M595244</guid>
      <dc:creator>Frank_Hartmann</dc:creator>
      <dc:date>2020-01-02T11:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: do while with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/do-while-with-if-statement/m-p/1662058#M595245</link>
      <description>&lt;P&gt;Hi Frank,&lt;/P&gt;&lt;P&gt;thanks for your quick answer.&lt;/P&gt;&lt;P&gt;Yes this works!&lt;/P&gt;&lt;P&gt;Have a nice day!&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 12:06:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/do-while-with-if-statement/m-p/1662058#M595245</guid>
      <dc:creator>wunderch</dc:creator>
      <dc:date>2020-01-02T12:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: do while with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/do-while-with-if-statement/m-p/1662068#M595246</link>
      <description>&lt;P&gt;if you want to do it with a do while clause then also try this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LET a=year(today())-5;
if num(month(Today()))=1 and num(day(today()))=1 then
do while a&amp;lt;=year(today())-1;

TEST:
Load
*,FileName() as Filename
From
[C:\Users\admin\Desktop\Neuer Ordner (5)\Test_$(a).xlsx]
(ooxml, embedded labels, table is Tabelle1);
Let a=$(a)+1;
loop;

ELSE

do while a&amp;lt;=year(today());
TEST:
Load
*,FileName() as Filename
From
[C:\Users\admin\Desktop\Neuer Ordner (5)\Test_$(a).xlsx]
(ooxml, embedded labels, table is Tabelle1);
Let a=$(a)+1;
Loop
ENDIF;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 12:31:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/do-while-with-if-statement/m-p/1662068#M595246</guid>
      <dc:creator>Frank_Hartmann</dc:creator>
      <dc:date>2020-01-02T12:31:31Z</dc:date>
    </item>
  </channel>
</rss>

