<?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: Duration between times over two rows in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Duration-between-times-over-two-rows/m-p/33490#M5672</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached qvw:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 May 2018 18:10:32 GMT</pubDate>
    <dc:creator>m_woolf</dc:creator>
    <dc:date>2018-05-30T18:10:32Z</dc:date>
    <item>
      <title>Duration between times over two rows</title>
      <link>https://community.qlik.com/t5/QlikView/Duration-between-times-over-two-rows/m-p/33489#M5671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see sample data attached. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm trying to do is find the duration between start and finish times for each employee for each date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im thinking something along the lines of :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If event type = F THEN use the previous row to get TimeIn and then work out the difference between the two time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bear in mind dates would have to be sorted correctly so it starts at the right point and the system would need to account for when it moves onto a row with a new employee. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please could you assist. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2018 15:56:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Duration-between-times-over-two-rows/m-p/33489#M5671</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-30T15:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Duration between times over two rows</title>
      <link>https://community.qlik.com/t5/QlikView/Duration-between-times-over-two-rows/m-p/33490#M5672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached qvw:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2018 18:10:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Duration-between-times-over-two-rows/m-p/33490#M5672</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2018-05-30T18:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Duration between times over two rows</title>
      <link>https://community.qlik.com/t5/QlikView/Duration-between-times-over-two-rows/m-p/33491#M5673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe one solution could be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_303257_Pic1.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/203960_QlikCommunity_Thread_303257_Pic1.JPG" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15277179593821749 jive_text_macro" jivemacro_uid="_15277179593821749"&gt;
&lt;P&gt;table1:&lt;/P&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Timestamp(Floor(Date)+Alt(TimeIn,TimeOut)) as DateTime,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(IsNum(TimeIn),'In','Out') as InOut&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;FROM [&lt;/SPAN&gt;&lt;A class="" data-containerid="-1" data-containertype="-1" data-objectid="327233" data-objecttype="13" href="https://community.qlik.com/servlet/JiveServlet/download/2051-303257-1494633-327233/Sample+Data1.xlsx"&gt;https://community.qlik.com/servlet/JiveServlet/download/1494633-327233/Sample%20Data1.xlsx&lt;/A&gt;&lt;SPAN&gt;] (ooxml, embedded labels, table is time);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;table2:&lt;/P&gt;
&lt;P&gt;LOAD Code,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FullName,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Previous(DateTime) as DateTimeIn,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime as DateTimeOut,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Interval(DateTime-Previous(DateTime)) as Duration&lt;/P&gt;
&lt;P&gt;Resident table1&lt;/P&gt;
&lt;P&gt;Where InOut='Out' and Previous(InOut)='In' and Code=Previous(Code)&lt;/P&gt;
&lt;P&gt;Order By Code, DateTime;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Table table1;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2018 22:06:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Duration-between-times-over-two-rows/m-p/33491#M5673</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2018-05-30T22:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Duration between times over two rows</title>
      <link>https://community.qlik.com/t5/QlikView/Duration-between-times-over-two-rows/m-p/33492#M5674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Marco - this works perfect. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2018 08:01:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Duration-between-times-over-two-rows/m-p/33492#M5674</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-31T08:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Duration between times over two rows</title>
      <link>https://community.qlik.com/t5/QlikView/Duration-between-times-over-two-rows/m-p/33493#M5675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you mw&amp;nbsp; - this also works perfect. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2018 08:01:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Duration-between-times-over-two-rows/m-p/33493#M5675</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-31T08:01:22Z</dc:date>
    </item>
  </channel>
</rss>

