<?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: Calculate average elapsed time in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-average-elapsed-time/m-p/1777516#M454989</link>
    <description>&lt;P&gt;Thanks! The peek function worked. I have the flat rate for all overall queries, however it doesn't work when I apply filters (such as client, week, product, etc.) - the equation continues calculating the time difference between the query executed immediately before, regardless of the filters applied.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm happy with having at least the overall flat rate, but if you have any ideas regarding the filters, I'd be happy to hear you out. Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jan 2021 17:18:07 GMT</pubDate>
    <dc:creator>SmartProtection</dc:creator>
    <dc:date>2021-01-26T17:18:07Z</dc:date>
    <item>
      <title>Calculate average elapsed time</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-average-elapsed-time/m-p/1776374#M454869</link>
      <description>&lt;P&gt;Hi everybody, have been tasked with a KPI that I can't seem to figure out, so we'll see if anyone can give ideas.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To keep it very simple, my company sends out queries to the internet, and clients hire us to do this for their products and present them with the results we collect.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Depending on the service level contracted, we have to send out queries at least 1x every 24 hours, 1x every 12 hrs, 1x every 6 hrs, 1x every hr, etc. My boss wants me to calculate a KPI that would be the average time elapsed between each query sent out. From there I could place filters to segment by client, product, service, etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a table, queries_executed, that includes a column which registers the time that each query was sent out. Is there a possible way to calculate the time difference for each of the executed queries in chronological order, and then calculate the average of these time differences?&amp;nbsp;&lt;/P&gt;&lt;P&gt;As an alternative, I have been able to calcule the avg. number of queries sent out per week/day/hr., but my boss is determined to have a timestamp KPI representing the average time difference between executed queries, to ensure that we are meeting the agreed-upon service levels&amp;nbsp; for each client, which is sending out a query once every x hrs (depending on service level contracted).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Including some of the relevant column headers in the Queries_Executed table:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- query_execution_id (generates 1 unique id for each query that is generated)&lt;/P&gt;&lt;P&gt;- query_executed_time (timestamp)&lt;/P&gt;&lt;P&gt;- query_id (this is the id of the phrase used in the query, which can be executed more than 1 time)&lt;/P&gt;&lt;P&gt;- network&amp;nbsp;&lt;/P&gt;&lt;P&gt;-client_id&lt;/P&gt;&lt;P&gt;-product_id&lt;/P&gt;&lt;P&gt;-number_results_collected&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any feedback or ideas to get me on the right track would be greatly appreciated! Thanks!&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, 21 Jan 2021 15:01:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-average-elapsed-time/m-p/1776374#M454869</guid>
      <dc:creator>SmartProtection</dc:creator>
      <dc:date>2021-01-21T15:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average elapsed time</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-average-elapsed-time/m-p/1776475#M454878</link>
      <description>&lt;P&gt;depending on volume:&lt;/P&gt;&lt;P&gt;1. you can loop through your data (as you said) in chronological order and use the peek function to get the previous time stamp&lt;/P&gt;&lt;P&gt;2. if the volume is large add a rownumber to each record (order by timestamp), then inner join to itself rownumber-1 and the timestamp, this way you have in one record the current rownumber, the current timestamp of that row, the timestamp of prior row (rownumber-1), you can now get the difference/interval&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 19:18:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-average-elapsed-time/m-p/1776475#M454878</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-01-21T19:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average elapsed time</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-average-elapsed-time/m-p/1776476#M454879</link>
      <description>&lt;P&gt;obviously, the first row will drop off (as there will be no row 0 to join with).&amp;nbsp; if you need that row, do a left join&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 19:20:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-average-elapsed-time/m-p/1776476#M454879</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-01-21T19:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average elapsed time</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-average-elapsed-time/m-p/1777516#M454989</link>
      <description>&lt;P&gt;Thanks! The peek function worked. I have the flat rate for all overall queries, however it doesn't work when I apply filters (such as client, week, product, etc.) - the equation continues calculating the time difference between the query executed immediately before, regardless of the filters applied.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm happy with having at least the overall flat rate, but if you have any ideas regarding the filters, I'd be happy to hear you out. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 17:18:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-average-elapsed-time/m-p/1777516#M454989</guid>
      <dc:creator>SmartProtection</dc:creator>
      <dc:date>2021-01-26T17:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average elapsed time</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-average-elapsed-time/m-p/1777553#M454991</link>
      <description>&lt;P&gt;both will work but be warned that the solution using peek function is slower and may not be feasible for large volume.&amp;nbsp; glad it helped and yw.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 21:51:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-average-elapsed-time/m-p/1777553#M454991</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-01-26T21:51:53Z</dc:date>
    </item>
  </channel>
</rss>

