<?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 Cyclic REST Connector in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Cyclic-REST-Connector/m-p/1521361#M600410</link>
    <description>&lt;P&gt;Hello,everybody!&lt;BR /&gt;Sorry for my poor English.&lt;/P&gt;&lt;P&gt;I can access the URL of the following specifications by REST connector.&lt;BR /&gt;1) I can get 500 records per 1 REST request.&lt;BR /&gt;2) I can get sorted records with the '$id' column by query parameters.&lt;BR /&gt;ex: $ID &amp;gt; 523&lt;/P&gt;&lt;P&gt;There are no problems if the number of records is 500 or less because I can get 1 request.&lt;BR /&gt;And the problem is over 500 records.&lt;/P&gt;&lt;P&gt;I can get more than 500records without problems with the script below, but it does not look elegant.&lt;/P&gt;&lt;P&gt;In VB and C #, the last '$id' value can be got by getting the value every time in the loop and passing through the loop.&lt;/P&gt;&lt;P&gt;In QlikView ,Is there any other way to get max function?&lt;BR /&gt;I tried using peek function peek('xxx',-1), but I got null.&lt;/P&gt;&lt;P&gt;-------------------------------------------&lt;BR /&gt;Let startId=0;&lt;BR /&gt;Let Recordcount=0;&lt;BR /&gt;Let PageCount=0;&lt;/P&gt;&lt;P&gt;Do&lt;BR /&gt;Let LastRecordcount=Recordcount;&lt;/P&gt;&lt;P&gt;RestConnectorMasterTable:&lt;BR /&gt;Load&lt;BR /&gt;*,&lt;BR /&gt;"__FK_$id" + (500*$(PageCount)) as __FK_$id_temp;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;BR /&gt;"__KEY_records",&lt;BR /&gt;(SELECT&lt;BR /&gt;"value" AS "value_u4",&lt;BR /&gt;"__FK_$id"&lt;BR /&gt;FROM "$id" FK "__FK_$id")&lt;BR /&gt;FROM JSON (wrap off) "records" PK "__KEY_records"&lt;BR /&gt;WITH CONNECTION(&lt;BR /&gt;QUERY "query" "$id &amp;gt; $(startId) order by $id"&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;BR /&gt;TempTable:&lt;BR /&gt;Load&lt;BR /&gt;max(value_u4) as _max_id&lt;BR /&gt;,count(value_u4) as _record_count&lt;BR /&gt;Resident RestConnectorMasterTable;&lt;/P&gt;&lt;P&gt;Let startId=peek('_max_id',0,'TempTable');&lt;BR /&gt;Let Recordcount=peek('_record_count',0,'TempTable');&lt;/P&gt;&lt;P&gt;DROP TABLE TempTable;&lt;/P&gt;&lt;P&gt;Let PageCount=PageCount+1;&lt;/P&gt;&lt;P&gt;Loop until LastRecordcount=Recordcount&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[$id]:&lt;BR /&gt;LOAD [value_u4] AS [kintone_id],&lt;BR /&gt;[__FK_$id_temp] AS [__KEY_records]&lt;BR /&gt;RESIDENT RestConnectorMasterTable&lt;BR /&gt;WHERE NOT IsNull([__FK_$id]);&lt;/P&gt;&lt;P&gt;DROP TABLE RestConnectorMasterTable;&lt;/P&gt;&lt;P&gt;exit Script;&lt;BR /&gt;-------------------------------------------&lt;/P&gt;&lt;P&gt;In addition, __KEY_records adds 500 * $ (PageCount) in order to obtain the value of 1 to 500 cyclically every time Do-Loop.&lt;/P&gt;&lt;P&gt;Please Help me.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 21:43:51 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T21:43:51Z</dc:date>
    <item>
      <title>Cyclic REST Connector</title>
      <link>https://community.qlik.com/t5/QlikView/Cyclic-REST-Connector/m-p/1521361#M600410</link>
      <description>&lt;P&gt;Hello,everybody!&lt;BR /&gt;Sorry for my poor English.&lt;/P&gt;&lt;P&gt;I can access the URL of the following specifications by REST connector.&lt;BR /&gt;1) I can get 500 records per 1 REST request.&lt;BR /&gt;2) I can get sorted records with the '$id' column by query parameters.&lt;BR /&gt;ex: $ID &amp;gt; 523&lt;/P&gt;&lt;P&gt;There are no problems if the number of records is 500 or less because I can get 1 request.&lt;BR /&gt;And the problem is over 500 records.&lt;/P&gt;&lt;P&gt;I can get more than 500records without problems with the script below, but it does not look elegant.&lt;/P&gt;&lt;P&gt;In VB and C #, the last '$id' value can be got by getting the value every time in the loop and passing through the loop.&lt;/P&gt;&lt;P&gt;In QlikView ,Is there any other way to get max function?&lt;BR /&gt;I tried using peek function peek('xxx',-1), but I got null.&lt;/P&gt;&lt;P&gt;-------------------------------------------&lt;BR /&gt;Let startId=0;&lt;BR /&gt;Let Recordcount=0;&lt;BR /&gt;Let PageCount=0;&lt;/P&gt;&lt;P&gt;Do&lt;BR /&gt;Let LastRecordcount=Recordcount;&lt;/P&gt;&lt;P&gt;RestConnectorMasterTable:&lt;BR /&gt;Load&lt;BR /&gt;*,&lt;BR /&gt;"__FK_$id" + (500*$(PageCount)) as __FK_$id_temp;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;BR /&gt;"__KEY_records",&lt;BR /&gt;(SELECT&lt;BR /&gt;"value" AS "value_u4",&lt;BR /&gt;"__FK_$id"&lt;BR /&gt;FROM "$id" FK "__FK_$id")&lt;BR /&gt;FROM JSON (wrap off) "records" PK "__KEY_records"&lt;BR /&gt;WITH CONNECTION(&lt;BR /&gt;QUERY "query" "$id &amp;gt; $(startId) order by $id"&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;BR /&gt;TempTable:&lt;BR /&gt;Load&lt;BR /&gt;max(value_u4) as _max_id&lt;BR /&gt;,count(value_u4) as _record_count&lt;BR /&gt;Resident RestConnectorMasterTable;&lt;/P&gt;&lt;P&gt;Let startId=peek('_max_id',0,'TempTable');&lt;BR /&gt;Let Recordcount=peek('_record_count',0,'TempTable');&lt;/P&gt;&lt;P&gt;DROP TABLE TempTable;&lt;/P&gt;&lt;P&gt;Let PageCount=PageCount+1;&lt;/P&gt;&lt;P&gt;Loop until LastRecordcount=Recordcount&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[$id]:&lt;BR /&gt;LOAD [value_u4] AS [kintone_id],&lt;BR /&gt;[__FK_$id_temp] AS [__KEY_records]&lt;BR /&gt;RESIDENT RestConnectorMasterTable&lt;BR /&gt;WHERE NOT IsNull([__FK_$id]);&lt;/P&gt;&lt;P&gt;DROP TABLE RestConnectorMasterTable;&lt;/P&gt;&lt;P&gt;exit Script;&lt;BR /&gt;-------------------------------------------&lt;/P&gt;&lt;P&gt;In addition, __KEY_records adds 500 * $ (PageCount) in order to obtain the value of 1 to 500 cyclically every time Do-Loop.&lt;/P&gt;&lt;P&gt;Please Help me.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 21:43:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cyclic-REST-Connector/m-p/1521361#M600410</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T21:43:51Z</dc:date>
    </item>
  </channel>
</rss>

