<?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: Planning to pull 7 days data in each loop using rest Api in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2454842#M98357</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22593"&gt;@rubenmarin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thank you for your valuable time, just want to confirm you are saying use&amp;nbsp;&lt;SPAN&gt;While $(vStartDate)&amp;lt;=$(vEndDate) instead of do While $(vStartDate)&amp;lt;=$(vEndDate)?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Irshad Ahmad&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 May 2024 17:42:23 GMT</pubDate>
    <dc:creator>iahmad9</dc:creator>
    <dc:date>2024-05-21T17:42:23Z</dc:date>
    <item>
      <title>Planning to pull 7 days data in each loop using rest Api</title>
      <link>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2453827#M98218</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;As per the business requirement, I need to pull 2 years of data from rest api but due to huge volume of data we can not pull two years data at a time. So I am planning to pull 7 days data using loop and finally concatenate data in final qvd.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Trying to use&amp;nbsp; this logic but this is for daily basis. I need to pull 7 days data in each loop so that api not stuck.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Let vStartDate = '01/01/2023';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Let vEndDate = Date(today(),'MM/DD/YYYY');&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;TempDate:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;LOAD Date(StartDate + IterNo() -1, 'MM/DD/YYYY') as TempDate&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;While StartDate + IterNo() -1 &amp;lt;= EndDate;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;LOAD * Inline [&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;StartDate, EndDate&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;$(vStartDate), $(vEndDate)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;CommaSeparatedDates:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;LOAD Concat(distinct Date(Date#(TempDate,'MM/DD/YYYY'),'YYYYMMDD'),',') as DateRange&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Resident TempDate&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;LET vDateRange = Peek('DateRange', 0); // using this variable in rest api filter.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note:Due to data security i cannot share all the table details.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;let me know in case of any other details to understand the requirements.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Irshad Ahmad&lt;/P&gt;</description>
      <pubDate>Sat, 18 May 2024 07:08:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2453827#M98218</guid>
      <dc:creator>iahmad9</dc:creator>
      <dc:date>2024-05-18T07:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Planning to pull 7 days data in each loop using rest Api</title>
      <link>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2453829#M98219</link>
      <description>&lt;P&gt;Hi, maybe a logic like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Let vStartDate = Num(Date('01/01/2023'));
Let vEndDate = Num(Date(today(),'MM/DD/YYYY'));

// Initialize table
DataTable:
LOAD Null() as dumbField Autogenerate 0;

// Start doing abucle to iterate forr each 7 days
Do While $(vStartDate)&amp;lt;=$(vEndDate)

// Only create dates for the StartDate and the next 6 days, or the EndDate if it's lower than StartDate+7
TempDate:
LOAD Date(StartDate + IterNo() -1, 'MM/DD/YYYY') as TempDate
While StartDate + IterNo() -1 &amp;lt;= RangeMin(EndDate, StartDate + 6);

LOAD * Inline [
StartDate, EndDate
$(vStartDate), $(vEndDate)
];

CommaSeparatedDates:
LOAD Concat(distinct Date(Date#(TempDate,'MM/DD/YYYY'),'YYYYMMDD'),',') as DateRange
Resident TempDate

LET vDateRange = Peek('DateRange', 0); // using this variable in rest api filter.

// After API query add data to table
Concatenate (DataTable)
LOAD * Resident APIResultTable;

// Delete tables used in the bucle to clean for next iteration
DROP Tables APIResultTable, CommaSeparatedDates, TempDate;

// Add days to start date fo next iteration of do..while
Let vStartDate = $(vStartDate)+7;

// End do..while
Loop

// Drop dumbField from table
DROP Field dumbField;&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 18 May 2024 08:09:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2453829#M98219</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2024-05-18T08:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Planning to pull 7 days data in each loop using rest Api</title>
      <link>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2454067#M98240</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22593"&gt;@rubenmarin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thank you for share the logic.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I checked this it seems good but when i am executing this code script data loading continuously.&lt;/P&gt;
&lt;P&gt;As for example:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Let vStartDate = Num(Date('01/01/2023'));
//Let vEndDate = Num(Date(today(),'MM/DD/YYYY'));
Let vEndDate = Num(Date('01/14/2023'));
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;starting of the script just i have changed end date 2 week only but script not getting finished in two loop. it is continue running i am not sure what is wrong with us. I would like to request you please cross check once. Thank you once again for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 07:39:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2454067#M98240</guid>
      <dc:creator>iahmad9</dc:creator>
      <dc:date>2024-05-20T07:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Planning to pull 7 days data in each loop using rest Api</title>
      <link>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2454100#M98244</link>
      <description>&lt;P&gt;Hi, be sure to add the 7 days to vStartDate before the next iteration of the bucle, so it only repeats while StartDate is lower than EndDate.&lt;/P&gt;
&lt;P&gt;You can execute in debug mode to check the values of each variable in each iteration&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 08:44:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2454100#M98244</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2024-05-20T08:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Planning to pull 7 days data in each loop using rest Api</title>
      <link>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2454419#M98291</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22593"&gt;@rubenmarin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thank you for responce.&lt;/P&gt;
&lt;P&gt;I also tried to execute this code in debug mode. Getting same issue. 7 days adding in each time but looping infinite. It would be great if you test this code from your end. Please find the code whihc i am executing in debug mode.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;Trace Full Load;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;Let vStartDate = Num(Date('01/01/2023'));&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;//Let vEndDate = Num(Date(today(),'MM/DD/YYYY'));&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;Let vEndDate = Num(Date('01/14/2023'));&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;// Initialize table&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;DataTable:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;LOAD Null() as dumbField Autogenerate 0;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;// Start doing abucle to iterate forr each 7 days&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;Do While $(vStartDate)&amp;lt;=$(vEndDate)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;// Only create dates for the StartDate and the next 6 days, or the EndDate if it's lower than StartDate+7&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;TempDate:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;LOAD Date(StartDate + IterNo() -1, 'MM/DD/YYYY') as TempDate&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;While StartDate + IterNo() -1 &amp;lt;= RangeMin(EndDate, StartDate + 6);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;LOAD * Inline [&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;StartDate, EndDate&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;$(vStartDate), $(vEndDate)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;CommaSeparatedDates:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;LOAD Concat(distinct Date(Date#(TempDate,'MM/DD/YYYY'),'YYYYMMDD'),',') as DateRange&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;Resident TempDate;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;LET vDateRange = Peek('DateRange', 0); // using this variable in rest api filter.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;Let vStartDate = $(vStartDate)+7;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;// End do..while&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;Loop&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;// Drop dumbField from table&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;DROP Field dumbField;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;// After API query add data to table&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;// Concatenate (DataTable)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;// LOAD * Resident APIResultTable;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;STRONG&gt;exit script;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Irshad Ahmad&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 06:22:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2454419#M98291</guid>
      <dc:creator>iahmad9</dc:creator>
      <dc:date>2024-05-21T06:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Planning to pull 7 days data in each loop using rest Api</title>
      <link>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2454753#M98338</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;Still, I am looking for the actual logic to pull the 7 days or less than 7 days data in rest API in loop.&lt;/P&gt;
&lt;P&gt;I am also trying from my side but not getting the expected solution. It would be much appreciated if you could provide some idea or logic.&lt;/P&gt;
&lt;P&gt;Please refer the above conversation for more details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Irshad Ahmad&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 14:23:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2454753#M98338</guid>
      <dc:creator>iahmad9</dc:creator>
      <dc:date>2024-05-21T14:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Planning to pull 7 days data in each loop using rest Api</title>
      <link>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2454823#M98354</link>
      <description>&lt;P&gt;Hi, sorry, I'm very busy these days... I tried and you are right: it doesn't ends.&lt;/P&gt;
&lt;P&gt;As I suppose the inital Startdate will be always lower than enddate, I just moved the while to the 'Loop' sentence instead of doing in the 'Do':&amp;nbsp;Loop While $(vStartDate)&amp;lt;=$(vEndDate)&lt;/P&gt;
&lt;P&gt;Remember that you also need to do the drop table to avoid the inline and&amp;nbsp;CommaSeparatedDates tables to add rows in each iteration&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 16:30:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2454823#M98354</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2024-05-21T16:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Planning to pull 7 days data in each loop using rest Api</title>
      <link>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2454842#M98357</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22593"&gt;@rubenmarin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thank you for your valuable time, just want to confirm you are saying use&amp;nbsp;&lt;SPAN&gt;While $(vStartDate)&amp;lt;=$(vEndDate) instead of do While $(vStartDate)&amp;lt;=$(vEndDate)?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Irshad Ahmad&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 17:42:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2454842#M98357</guid>
      <dc:creator>iahmad9</dc:creator>
      <dc:date>2024-05-21T17:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Planning to pull 7 days data in each loop using rest Api</title>
      <link>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2454936#M98369</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22593"&gt;@rubenmarin&lt;/a&gt;&amp;nbsp; I got the expected output. Thank you once again for you time to support.&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 01:44:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Planning-to-pull-7-days-data-in-each-loop-using-rest-Api/m-p/2454936#M98369</guid>
      <dc:creator>iahmad9</dc:creator>
      <dc:date>2024-05-22T01:44:38Z</dc:date>
    </item>
  </channel>
</rss>

