<?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: Adjustment to requirements in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Find-hours-between-dates-excluding-weekend-and-non-working-hours/m-p/1697480#M592688</link>
    <description>&lt;P&gt;Thanks and it is great!!&lt;/P&gt;</description>
    <pubDate>Tue, 28 Apr 2020 18:47:39 GMT</pubDate>
    <dc:creator>kumaranvr1984</dc:creator>
    <dc:date>2020-04-28T18:47:39Z</dc:date>
    <item>
      <title>Find hours between dates excluding weekend and non working hours</title>
      <link>https://community.qlik.com/t5/QlikView/Find-hours-between-dates-excluding-weekend-and-non-working-hours/m-p/1696786#M592686</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I was asked this help that, we have to find the hours between dates where we need to exclude week end and non working hours. I found the solution and I thought of sharing this here so it may useful for some one.&lt;/P&gt;&lt;P&gt;=Interval(&lt;BR /&gt;(($(vEworkhrs)-maketime(hour(Ticket_open),minute(Ticket_open),Second(Ticket_open)))&lt;BR /&gt;+(maketime(hour(Ticket_close),minute(Ticket_close),Second(Ticket_close))-$(vSworkhrs))&lt;BR /&gt;+((NetWorkDays(Ticket_open,Ticket_close)-2)*($(vEworkhrs)-$(vSworkhrs)))),'hh:mm:ss')&lt;/P&gt;&lt;P&gt;here vSworkhrs = process starting hour and vEworkhrs = process end hours.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kumaran&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2020 09:38:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-hours-between-dates-excluding-weekend-and-non-working-hours/m-p/1696786#M592686</guid>
      <dc:creator>kumaranvr1984</dc:creator>
      <dc:date>2020-04-26T09:38:05Z</dc:date>
    </item>
    <item>
      <title>Adjustment to requirements</title>
      <link>https://community.qlik.com/t5/QlikView/Find-hours-between-dates-excluding-weekend-and-non-working-hours/m-p/1697439#M592687</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I developed a solution for a ticket system and had also to get the timedifference between ticket open and first working step on the ticket. I developed an own method which is more complicated than the solution of Kumaran!&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I had to adjust the solution due to the requirements of the ticket system, because a ticket should be transfered to&amp;nbsp;first working step soon (mostly within seconds, but a lot of tickets are transferred within days!). And a ticket could be opened or ended out of working hours. So I needed to take care of this.&lt;BR /&gt;Besides weekends, public holidays should also not be regarded. I Used the customers calendar and extracted the public holidays in the variable vFreeDays in format 'YYYY-MM-DD','YYYY-MM-DD',.....&lt;/P&gt;&lt;P&gt;BEGTI&lt;SPAN&gt;ME and ENDTIME have format TIMESTAMP! vWorkStart and vWorkEnd have format Time (hh:mm)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;My solution :&lt;/P&gt;&lt;P&gt;if (NetWorkDays(BEGTIME,ENDTIME,$(vFreeDays))=1, // &lt;STRONG&gt;if task starts and ends on same day!!&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if ((time(frac(BEGTIME))&amp;gt;$(vWorkEnd)) or (time(frac(ENDTIME))&amp;lt;$(vWorkStart)),&amp;nbsp;// if start or end time are out of working hours, set to 0!&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0,&amp;nbsp;&lt;BR /&gt;// otherwise just subtract the start time from end time ( open: 15:00,&amp;nbsp; end: 19:00, working end 18:00,&amp;nbsp; result in 3 hours!&lt;BR /&gt;Interval(&lt;BR /&gt;Rangemin(time(frac(ENDTIME)),$(vWorkEnd)) // if ticket end is after working hour, take end of working hour !!&lt;BR /&gt;-Rangemax(time(frac(BEGTIME)),$(vWorkStart))&amp;nbsp; //if ticket was opened before working hour, take start of working hours&lt;BR /&gt;)), &lt;STRONG&gt;// if ticket is handled over at least 2 days&lt;/STRONG&gt;&lt;BR /&gt;Interval(&lt;BR /&gt;(($(vWorkEnd)-Rangemax(time(frac(BEGTIME)),$(vWorkStart)))&lt;BR /&gt;+(Rangemin(time(frac(BEGTIME)),$(vWorkEnd))-$(vWorkStart))&lt;BR /&gt;+((NetWorkDays(BEGTIME,ENDTIME,$(vFreeDays))-2)*($(vWorkEnd)-$(vWorkStart)))))) as Duration;&lt;/P&gt;&lt;P&gt;So thank you Kumaran for your idea!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 15:11:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-hours-between-dates-excluding-weekend-and-non-working-hours/m-p/1697439#M592687</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-28T15:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustment to requirements</title>
      <link>https://community.qlik.com/t5/QlikView/Find-hours-between-dates-excluding-weekend-and-non-working-hours/m-p/1697480#M592688</link>
      <description>&lt;P&gt;Thanks and it is great!!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 18:47:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-hours-between-dates-excluding-weekend-and-non-working-hours/m-p/1697480#M592688</guid>
      <dc:creator>kumaranvr1984</dc:creator>
      <dc:date>2020-04-28T18:47:39Z</dc:date>
    </item>
  </channel>
</rss>

