<?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 Where Clause in Rest API Query in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-Clause-in-Rest-API-Query/m-p/2014106#M11744</link>
    <description>&lt;P&gt;I have a working rest connection against a Azure Cosmos DB API.&amp;nbsp; What I am trying to do is include a where clause on the&amp;nbsp;"_ts" field (time stamp in a unix format).&amp;nbsp; The reason for doing this is so I don't reload the entire API contents every time and set up weekly incremental loads.&amp;nbsp; Later on in the UI dashboard I convert this to a normal date format using&amp;nbsp;date(floor([_ts]/86400)+25569,'YYYY-MM-DD') as Date.&amp;nbsp; My issue is I can not seem to figure out where to put it and with what syntax.&amp;nbsp; Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;Week_Period_List:&lt;BR /&gt;load &lt;BR /&gt;date(weekstart(Today()),'YYYY-MM-DD') as Week_Period&lt;BR /&gt;AutoGenerate(1)&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;concatenate(Week_Period_List)&lt;/P&gt;
&lt;P&gt;load &lt;BR /&gt;date(weekstart((Today()-6)),'YYYY-MM-DD') as Week_Period&lt;BR /&gt;AutoGenerate(1)&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;FOR v_RowCounter = 0 TO NoOfRows('Week_Period_List')-1;&lt;/P&gt;
&lt;P&gt;LET v_WeekPeriod = peek('Week_Period',$(v_RowCounter),'Week_Period_List');&lt;/P&gt;
&lt;P&gt;LIB CONNECT TO 'REST_CosmosDB_Data_Retrieve';&lt;/P&gt;
&lt;P&gt;RestConnectorMasterTable:&lt;BR /&gt;SQL SELECT &lt;BR /&gt;"_rid" AS "_rid_u0",&lt;BR /&gt;"__KEY_root",&lt;BR /&gt;(SELECT &lt;BR /&gt;"id",&lt;BR /&gt;"RequestPath",&lt;BR /&gt;"GatewayType",&lt;BR /&gt;"SourceTransactionId",&lt;BR /&gt;"ChannelId",&lt;BR /&gt;"AppId",&lt;BR /&gt;"Status",&lt;BR /&gt;"IsSuccess",&lt;BR /&gt;"TransactionAmount",&lt;BR /&gt;"ResponseCode",&lt;BR /&gt;"Duration",&lt;BR /&gt;"_rid",&lt;BR /&gt;"_self",&lt;BR /&gt;"_etag",&lt;BR /&gt;"_attachments",&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;"_ts",&amp;nbsp; &amp;lt;-- Unix time stamp formatted like this&amp;nbsp;1670112040 is really 2022-12-04.&amp;nbsp; I want to pass the&amp;nbsp;v_WeekPeriod variable in a where clause&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;"PolicyNumber",&lt;BR /&gt;"BillingAccountNumber",&lt;BR /&gt;"ErrorMessages",&lt;BR /&gt;"Exception",&lt;BR /&gt;"__KEY_Documents",&lt;BR /&gt;"__FK_Documents",&lt;BR /&gt;(SELECT &lt;BR /&gt;"ProcessorResponseCode",&lt;BR /&gt;"ProcessorResponseText",&lt;BR /&gt;"TransactionId",&lt;BR /&gt;"__FK_TransactionLog"&lt;BR /&gt;FROM "TransactionLog" FK "__FK_TransactionLog")&lt;BR /&gt;FROM "Documents" PK "__KEY_Documents" FK "__FK_Documents")&lt;BR /&gt;FROM JSON (wrap on) "root" PK "__KEY_root"&lt;BR /&gt;WITH CONNECTION(url "$(v_EnvironmentURL)",&lt;BR /&gt;HTTPHEADER "Authorization" "$(vSessionId)",&lt;BR /&gt;HTTPHEADER "x-ms-date" "$(vMS_Date)",&lt;BR /&gt;HTTPHEADER "x-ms-version" "$(vMS_Version)",&lt;BR /&gt;HTTPHEADER "x-ms-max-item-count" "10" )&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;next v_RowCounter&lt;/P&gt;</description>
    <pubDate>Thu, 08 Dec 2022 01:56:39 GMT</pubDate>
    <dc:creator>carlcimino</dc:creator>
    <dc:date>2022-12-08T01:56:39Z</dc:date>
    <item>
      <title>Where Clause in Rest API Query</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-Clause-in-Rest-API-Query/m-p/2014106#M11744</link>
      <description>&lt;P&gt;I have a working rest connection against a Azure Cosmos DB API.&amp;nbsp; What I am trying to do is include a where clause on the&amp;nbsp;"_ts" field (time stamp in a unix format).&amp;nbsp; The reason for doing this is so I don't reload the entire API contents every time and set up weekly incremental loads.&amp;nbsp; Later on in the UI dashboard I convert this to a normal date format using&amp;nbsp;date(floor([_ts]/86400)+25569,'YYYY-MM-DD') as Date.&amp;nbsp; My issue is I can not seem to figure out where to put it and with what syntax.&amp;nbsp; Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;Week_Period_List:&lt;BR /&gt;load &lt;BR /&gt;date(weekstart(Today()),'YYYY-MM-DD') as Week_Period&lt;BR /&gt;AutoGenerate(1)&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;concatenate(Week_Period_List)&lt;/P&gt;
&lt;P&gt;load &lt;BR /&gt;date(weekstart((Today()-6)),'YYYY-MM-DD') as Week_Period&lt;BR /&gt;AutoGenerate(1)&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;FOR v_RowCounter = 0 TO NoOfRows('Week_Period_List')-1;&lt;/P&gt;
&lt;P&gt;LET v_WeekPeriod = peek('Week_Period',$(v_RowCounter),'Week_Period_List');&lt;/P&gt;
&lt;P&gt;LIB CONNECT TO 'REST_CosmosDB_Data_Retrieve';&lt;/P&gt;
&lt;P&gt;RestConnectorMasterTable:&lt;BR /&gt;SQL SELECT &lt;BR /&gt;"_rid" AS "_rid_u0",&lt;BR /&gt;"__KEY_root",&lt;BR /&gt;(SELECT &lt;BR /&gt;"id",&lt;BR /&gt;"RequestPath",&lt;BR /&gt;"GatewayType",&lt;BR /&gt;"SourceTransactionId",&lt;BR /&gt;"ChannelId",&lt;BR /&gt;"AppId",&lt;BR /&gt;"Status",&lt;BR /&gt;"IsSuccess",&lt;BR /&gt;"TransactionAmount",&lt;BR /&gt;"ResponseCode",&lt;BR /&gt;"Duration",&lt;BR /&gt;"_rid",&lt;BR /&gt;"_self",&lt;BR /&gt;"_etag",&lt;BR /&gt;"_attachments",&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;"_ts",&amp;nbsp; &amp;lt;-- Unix time stamp formatted like this&amp;nbsp;1670112040 is really 2022-12-04.&amp;nbsp; I want to pass the&amp;nbsp;v_WeekPeriod variable in a where clause&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;"PolicyNumber",&lt;BR /&gt;"BillingAccountNumber",&lt;BR /&gt;"ErrorMessages",&lt;BR /&gt;"Exception",&lt;BR /&gt;"__KEY_Documents",&lt;BR /&gt;"__FK_Documents",&lt;BR /&gt;(SELECT &lt;BR /&gt;"ProcessorResponseCode",&lt;BR /&gt;"ProcessorResponseText",&lt;BR /&gt;"TransactionId",&lt;BR /&gt;"__FK_TransactionLog"&lt;BR /&gt;FROM "TransactionLog" FK "__FK_TransactionLog")&lt;BR /&gt;FROM "Documents" PK "__KEY_Documents" FK "__FK_Documents")&lt;BR /&gt;FROM JSON (wrap on) "root" PK "__KEY_root"&lt;BR /&gt;WITH CONNECTION(url "$(v_EnvironmentURL)",&lt;BR /&gt;HTTPHEADER "Authorization" "$(vSessionId)",&lt;BR /&gt;HTTPHEADER "x-ms-date" "$(vMS_Date)",&lt;BR /&gt;HTTPHEADER "x-ms-version" "$(vMS_Version)",&lt;BR /&gt;HTTPHEADER "x-ms-max-item-count" "10" )&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;next v_RowCounter&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 01:56:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Where-Clause-in-Rest-API-Query/m-p/2014106#M11744</guid>
      <dc:creator>carlcimino</dc:creator>
      <dc:date>2022-12-08T01:56:39Z</dc:date>
    </item>
  </channel>
</rss>

