<?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: Interval calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Interval-calculation/m-p/733793#M475989</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your quick answer, it's working.&lt;/P&gt;&lt;P&gt;I missed to mention that I have several occurrences for each Entity and now I want to average them :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Entity - Occurence - Date of Arrival - Start Working time per gang - End Working time per gang - Date of Departure&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;A - Occurence 1 - 24/06/2014 08:00 - 24/06/2014 08:12 - 24/06/2014 17:00 - 24/06/2014 20:00&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;A - Occurence 1 - 24/06/2014 08:00 - 24/06/2014 08:03 - 24/06/2014 12:17 - 24/06/2014 20:00&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;A - Occurence 1 - 24/06/2014 08:00 - 24/06/2014 13:17 - 24/06/2014 18:15 - 24/06/2014 20:00&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;A - Occurence 2 - 15/06/2014 12:00 - 15/06/2014 12:05 - 15/06/2014 15:05 - 15/06/2014 18:00&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;A - Occurence 2 - 15/06/2014 12:00 - 15/06/2014 13:00 - 15/06/2014 14:00 - 15/06/2014 18:00&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;B - etc&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;So Waiting time before work for Entity A - Occurence 1 = 3 minutes&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Waiting time before work for Entity A - Occurence 2 = 5 minutes&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I want to show Average time before work for Entity A = 4 minutes&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I set Entity as dimensions and used :&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;avg&lt;/STRONG&gt;(interval(min([&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Start Working time per gang&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;]) - [&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Date of Arrival&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;], 'hh:mm:ss'))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;But I get no result.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jun 2014 12:33:58 GMT</pubDate>
    <dc:creator>takama13</dc:creator>
    <dc:date>2014-06-24T12:33:58Z</dc:date>
    <item>
      <title>Interval calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-calculation/m-p/733791#M475987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm a fresh new user of Qlikview.&lt;/P&gt;&lt;P&gt;I have an excel database organized as per below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Entity - Date of Arrival - Start Working time per gang - End Working time per gang - Date of Departure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which leads to this king of data :&lt;/P&gt;&lt;P&gt;A - 24/06/2014 08:00 - 24/06/2014 08:12 - 24/06/2014 17:00 - 24/06/2014 20:00&lt;/P&gt;&lt;P&gt;A - 24/06/2014 08:00 - 24/06/2014 08:03 - 24/06/2014 12:17 - 24/06/2014 20:00&lt;/P&gt;&lt;P&gt;A - 24/06/2014 08:00 - 24/06/2014 13:17 - 24/06/2014 18:15 - 24/06/2014 20:00&lt;/P&gt;&lt;P&gt;B - 20/06/2014 23:00 - 21/06/2014 01:12 - 21/06/2014 05:12 - 21/06/2014 08:00&lt;/P&gt;&lt;P&gt;B - 20/06/2014 23:00 - 20/06/2014 23:15 - 21/06/2014 07:55 - 21/06/2014 08:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So fear each entity, Date of Arrival and Date of Departure are the same. What is changing for each entity is the Start and End of Working time per gang. I would like to calculate the waiting time for each entity before and after work times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore for entity A, I need to calculate :&lt;/P&gt;&lt;P&gt;Waiting time before start of work = "earliest Start Working time for entity A" - 'Date of Arrival" = "24/06/2014 08:03" - "24/06/2014 08:00" = 3 minutes&lt;/P&gt;&lt;P&gt;Waiting time after end of work = "Date of Departure" - "latest End Working time for entity A" = "24/06/2014 20:00" - "24/06/2014 18:15" = 1 hour and 45 minutes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do that with Qlikview ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 10:36:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-calculation/m-p/733791#M475987</guid>
      <dc:creator>takama13</dc:creator>
      <dc:date>2014-06-24T10:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Interval calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-calculation/m-p/733792#M475988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use entity as dimension and two expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;interval(min([&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Start Working time per gang&lt;/SPAN&gt;]) - [&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Date of Arrival&lt;/SPAN&gt;], 'hh:mm:ss')&lt;/P&gt;&lt;P&gt;interval([&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Date of Departure&lt;/SPAN&gt;] - max([&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Start Working time per gang&lt;/SPAN&gt;]), 'hh:mm:ss')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your datetimes are string values then first make numeric timestamps from them in the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Entity,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timestamp#([&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Start Working time per gang&lt;/SPAN&gt;],'DD/MM/YYYY hh:mm') as [&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Start Working time per gang&lt;/SPAN&gt;],&lt;/P&gt;&lt;P&gt;&lt;EM&gt;...etc&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;FROM &lt;EM&gt;...mysource...&lt;/EM&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 10:40:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-calculation/m-p/733792#M475988</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-06-24T10:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Interval calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-calculation/m-p/733793#M475989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your quick answer, it's working.&lt;/P&gt;&lt;P&gt;I missed to mention that I have several occurrences for each Entity and now I want to average them :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Entity - Occurence - Date of Arrival - Start Working time per gang - End Working time per gang - Date of Departure&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;A - Occurence 1 - 24/06/2014 08:00 - 24/06/2014 08:12 - 24/06/2014 17:00 - 24/06/2014 20:00&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;A - Occurence 1 - 24/06/2014 08:00 - 24/06/2014 08:03 - 24/06/2014 12:17 - 24/06/2014 20:00&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;A - Occurence 1 - 24/06/2014 08:00 - 24/06/2014 13:17 - 24/06/2014 18:15 - 24/06/2014 20:00&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;A - Occurence 2 - 15/06/2014 12:00 - 15/06/2014 12:05 - 15/06/2014 15:05 - 15/06/2014 18:00&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;A - Occurence 2 - 15/06/2014 12:00 - 15/06/2014 13:00 - 15/06/2014 14:00 - 15/06/2014 18:00&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;B - etc&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;So Waiting time before work for Entity A - Occurence 1 = 3 minutes&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Waiting time before work for Entity A - Occurence 2 = 5 minutes&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I want to show Average time before work for Entity A = 4 minutes&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I set Entity as dimensions and used :&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;avg&lt;/STRONG&gt;(interval(min([&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Start Working time per gang&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;]) - [&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Date of Arrival&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;], 'hh:mm:ss'))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;But I get no result.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 12:33:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-calculation/m-p/733793#M475989</guid>
      <dc:creator>takama13</dc:creator>
      <dc:date>2014-06-24T12:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Interval calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-calculation/m-p/733794#M475990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you nest aggregation functions, like avg and min, then you need to use the aggr function. Try&lt;/P&gt;&lt;P&gt;avg(aggr(interval(min([Start Working time per gang]) - [Date of Arrival], 'hh:mm:ss'),Entity,Occurence))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 12:41:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-calculation/m-p/733794#M475990</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-06-24T12:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Interval calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-calculation/m-p/733795#M475991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I understant the concept.&lt;/P&gt;&lt;P&gt;I now have a result but the value returned is... a value.&lt;/P&gt;&lt;P&gt;How can I show it as a time ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT : this time could be over 24. So I would like to be able to show 36 hours for example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 12:53:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-calculation/m-p/733795#M475991</guid>
      <dc:creator>takama13</dc:creator>
      <dc:date>2014-06-24T12:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Interval calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-calculation/m-p/733796#M475992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can move the interval function in the expression to around the avg function instead of around the min function where it is now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 12:57:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-calculation/m-p/733796#M475992</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-06-24T12:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Interval calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-calculation/m-p/733797#M475993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working perfectly, thank you very much !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 13:05:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-calculation/m-p/733797#M475993</guid>
      <dc:creator>takama13</dc:creator>
      <dc:date>2014-06-24T13:05:50Z</dc:date>
    </item>
  </channel>
</rss>

