<?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: Worked hours for a day in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Worked-hours-for-a-day/m-p/612902#M226173</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Nick, look at the intervalmatch script function, this will allow you to join or associate each day between day between the start and the end then calculate the number of hours, or easier if a shift only went over a single day boundary for the records going over the midnight boundary just load a table which concatenates the start date with the hours from the start till midnight then the end date with the hours from midnight to the end (then add on the records which just exist in a single day. ie the table &lt;/P&gt;&lt;P&gt;EMP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; START&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/05/2005 22:00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/05/2005&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03:00&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/05/2005 05:00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/05/2005&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10:00&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;would become&lt;/P&gt;&lt;P&gt;EMP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hours&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/05/2005&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/05/2005&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/05/2005&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;once you have the table in this structure the pivot table should be straght forward.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Mar 2014 08:05:54 GMT</pubDate>
    <dc:creator>sbaldwin</dc:creator>
    <dc:date>2014-03-07T08:05:54Z</dc:date>
    <item>
      <title>Worked hours for a day</title>
      <link>https://community.qlik.com/t5/QlikView/Worked-hours-for-a-day/m-p/612901#M226172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a record with these fields:&lt;/P&gt;&lt;P&gt;- Employee nbr.&lt;/P&gt;&lt;P&gt;- Date/time start&lt;/P&gt;&lt;P&gt;- Date/time finish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to make a qw pivot table with the days on the x-axe, the employee nbr on the y-axe and show the worked hour for a day/employee.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that the start date and the finish date could be not the same (e.g. from 22:00 of March 7th to 06:00 of March 8th), so the right hours-for-a-day should be: 2 on March 7th and 6 on March 8th, but I'm not able to show them in a qw pivot table, bacause I have them in only record and not in two.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I Hope the problem is clear &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody help me to find a way to solve this riddle?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nick.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2014 07:57:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Worked-hours-for-a-day/m-p/612901#M226172</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-07T07:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Worked hours for a day</title>
      <link>https://community.qlik.com/t5/QlikView/Worked-hours-for-a-day/m-p/612902#M226173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Nick, look at the intervalmatch script function, this will allow you to join or associate each day between day between the start and the end then calculate the number of hours, or easier if a shift only went over a single day boundary for the records going over the midnight boundary just load a table which concatenates the start date with the hours from the start till midnight then the end date with the hours from midnight to the end (then add on the records which just exist in a single day. ie the table &lt;/P&gt;&lt;P&gt;EMP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; START&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/05/2005 22:00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/05/2005&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03:00&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/05/2005 05:00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/05/2005&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10:00&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;would become&lt;/P&gt;&lt;P&gt;EMP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hours&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/05/2005&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/05/2005&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/05/2005&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;once you have the table in this structure the pivot table should be straght forward.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2014 08:05:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Worked-hours-for-a-day/m-p/612902#M226173</guid>
      <dc:creator>sbaldwin</dc:creator>
      <dc:date>2014-03-07T08:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Worked hours for a day</title>
      <link>https://community.qlik.com/t5/QlikView/Worked-hours-for-a-day/m-p/612903#M226174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wasn't able to use the INTERVALMATCH function, but I get your 2nd suggestion and I solve the problem with a UNION ALL into the SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bye.&lt;/P&gt;&lt;P&gt;Nick.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2014 14:30:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Worked-hours-for-a-day/m-p/612903#M226174</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-07T14:30:51Z</dc:date>
    </item>
  </channel>
</rss>

