<?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: Can you create a macro in QlickView? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Can-you-create-a-macro-in-QlickView/m-p/572896#M1107580</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check out the FOR loop functionality for loads. You can specify a list or you can even load all files in a directory&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;FOR &lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;EACH &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;BILLFile &lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IN &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;FY13\NEG_BILL.PRN', '&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;FY14\NEG_BILL.PRN'&lt;BR /&gt;&lt;BR /&gt;BILL:&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FROM &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(BILLFile) &lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;txt &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;codepage&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; 1252, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;no&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;labels&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;delimiter&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; ',', &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;msq&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;); &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Mar 2014 18:11:41 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-03-13T18:11:41Z</dc:date>
    <item>
      <title>Can you create a macro in QlickView?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-you-create-a-macro-in-QlickView/m-p/572894#M1107577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a database that only allows me to pull 5,000 records at a time via an API call.&amp;nbsp; Can I write a Macro in QlickView that will allow me to cycle through one load statement changing the "skip" "take" values in the API call?&amp;nbsp; Or do I just need to stack my load statements to pull all the records?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Situation:&lt;/P&gt;&lt;P&gt;Lets say I want to pull in 100,000 records from a database.&amp;nbsp; My only way to access the database is via API call.&amp;nbsp; But the API times out if you try to pull more than 5,000 records at a time.&amp;nbsp; So I set the API "skip &amp;amp; take" function to pull only 5,000 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example API Load statement:&lt;/P&gt;&lt;P&gt;MyTable:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field1, Field2, Field3, Field4&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FROM '[&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://myapi.source.net/?key=1234&amp;amp;param1=2&amp;amp;StartDate=2/1/2014"&gt;https://myapi.source.net/?key=1234&amp;amp;param1=2&amp;amp;StartDate=2/1/2014&lt;/A&gt;&lt;SPAN&gt; 00:00:00&amp;amp;EndDate=2/28/2014 23:59:59&amp;amp;skip=0&amp;amp;take=5000] (XmlSimple, table is [MyTable/MyTable])';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to do:&lt;/P&gt;&lt;P&gt;I want to iterate through the Load statement until I have pulled all 100,000 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;Is it better to stack your load statements like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MyTable:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field1, Field2, Field3, Field4&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FROM '[&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://myapi.source.net/?key=1234&amp;amp;param1=2&amp;amp;StartDate=2/1/2014"&gt;https://myapi.source.net/?key=1234&amp;amp;param1=2&amp;amp;StartDate=2/1/2014&lt;/A&gt;&lt;SPAN&gt; 00:00:00&amp;amp;EndDate=2/28/2014 23:59:59&amp;amp;skip=0&amp;amp;take=5000] (XmlSimple, table is [MyTable/MyTable])';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field1, Field2, Field3, Field4&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FROM '[&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://myapi.source.net/?key=1234&amp;amp;param1=2&amp;amp;StartDate=2/1/2014"&gt;https://myapi.source.net/?key=1234&amp;amp;param1=2&amp;amp;StartDate=2/1/2014&lt;/A&gt;&lt;SPAN&gt; 00:00:00&amp;amp;EndDate=2/28/2014 23:59:59&amp;amp;skip=5000&amp;amp;take=5000] (XmlSimple, table is [MyTable/MyTable])';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field1, Field2, Field3, Field4&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FROM '[&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://myapi.source.net/?key=1234&amp;amp;param1=2&amp;amp;StartDate=2/1/2014"&gt;https://myapi.source.net/?key=1234&amp;amp;param1=2&amp;amp;StartDate=2/1/2014&lt;/A&gt;&lt;SPAN&gt; 00:00:00&amp;amp;EndDate=2/28/2014 23:59:59&amp;amp;skip=10000&amp;amp;take=5000] (XmlSimple, table is [MyTable/MyTable])';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;Can I write a Macro that will allow me to utilize the 1 load statement and just dynamically change the values of Skip &amp;amp; Take?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 14:47:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-you-create-a-macro-in-QlickView/m-p/572894#M1107577</guid>
      <dc:creator />
      <dc:date>2014-03-13T14:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can you create a macro in QlickView?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-you-create-a-macro-in-QlickView/m-p/572895#M1107579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;UPDATED : you do not need a macro you need a for next loop ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i = 0 to 19&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Load&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field1, Field2, Field3, Field4&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;FROM '[&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://myapi.source.net/?key=1234&amp;amp;param1=2&amp;amp;StartDate=2/1/2014" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #3778c7;"&gt;https://myapi.source.net/?key=1234&amp;amp;param1=2&amp;amp;StartDate=2/1/2014&lt;/A&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt; 00:00:00&amp;amp;EndDate=2/28/2014 23:59:59&amp;amp;skip=' &amp;amp; $(i)*5000 &amp;amp; '&amp;amp;take=5000] (XmlSimple, table is [MyTable/MyTable])';&lt;/SPAN&gt;&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, 13 Mar 2014 17:02:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-you-create-a-macro-in-QlickView/m-p/572895#M1107579</guid>
      <dc:creator>giakoum</dc:creator>
      <dc:date>2014-03-13T17:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can you create a macro in QlickView?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-you-create-a-macro-in-QlickView/m-p/572896#M1107580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check out the FOR loop functionality for loads. You can specify a list or you can even load all files in a directory&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;FOR &lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;EACH &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;BILLFile &lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IN &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;FY13\NEG_BILL.PRN', '&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;FY14\NEG_BILL.PRN'&lt;BR /&gt;&lt;BR /&gt;BILL:&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FROM &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(BILLFile) &lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;txt &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;codepage&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; 1252, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;no&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;labels&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;delimiter&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; ',', &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;msq&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;); &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 18:11:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-you-create-a-macro-in-QlickView/m-p/572896#M1107580</guid>
      <dc:creator />
      <dc:date>2014-03-13T18:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can you create a macro in QlickView?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-you-create-a-macro-in-QlickView/m-p/572897#M1107582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey David,&lt;/P&gt;&lt;P&gt;You can use a do loop function. This is commonly done while reading data from AD groups because of the number of records that could be pulled at a time limitation.&lt;/P&gt;&lt;P&gt;Original post:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/50661"&gt;Connecting to and Querying Active Directory for Users&lt;/A&gt;&lt;/P&gt;&lt;P&gt;you can tweak it per needs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;AJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 18:23:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-you-create-a-macro-in-QlickView/m-p/572897#M1107582</guid>
      <dc:creator />
      <dc:date>2014-03-13T18:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can you create a macro in QlickView?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-you-create-a-macro-in-QlickView/m-p/572898#M1107583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ioannis. An example of the final code that worked for me is below.&amp;nbsp; Its a combination of FOR -&amp;gt; NEXT &amp;amp; DO -&amp;gt; WHILE.&amp;nbsp; Your responses led me to a solution that works for my particular situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vToday = Timestamp(Now(), 'MM/DD/YYYY hh:mm:ss' );&lt;/P&gt;&lt;P&gt;Let i=0;&lt;/P&gt;&lt;P&gt;for i = 0 to 19&lt;/P&gt;&lt;P&gt;do while 1 &amp;lt;= 19&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;Load statement....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sortdata:&lt;/P&gt;&lt;P&gt;Load * resident Table1 Order By Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vDate = Peek('Date',-1,'SortData');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop Table Table1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Incremental:&lt;/P&gt;&lt;P&gt;Load statement...&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;From [&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://myapi.com/?key=123&amp;amp;StartDate=$(vDate)&amp;amp;"&gt;http://myapi.com/?key=123&amp;amp;StartDate=$(vDate)&amp;amp;&lt;/A&gt;&lt;SPAN&gt; 00:00:00&amp;amp;EndDate=$(vToday)&amp;amp;skip=&amp;amp;$(i)*5000$take=5000] (XmlSimple, Table is [Table1]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate&lt;/P&gt;&lt;P&gt;Load statement....&lt;/P&gt;&lt;P&gt;Where not exists (DBRecordKey);&amp;nbsp; //prevents duplicate records from being loaded&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store Incremental into Table1.qvd(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table Incremental;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i=(i)+1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;Load statement....&amp;nbsp; // this loads the all the old and new data into the view.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 15:42:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-you-create-a-macro-in-QlickView/m-p/572898#M1107583</guid>
      <dc:creator />
      <dc:date>2014-03-18T15:42:38Z</dc:date>
    </item>
  </channel>
</rss>

