<?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: WorkingHours excluding weekends and Consider working hours between 9 to 17:30 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/WorkingHours-excluding-weekends-and-Consider-working-hours/m-p/1777295#M454970</link>
    <description>&lt;P&gt;maybe you can add an if statement if both start date and end dates are inside the valid time range.&amp;nbsp; since the fields are in separate tables, you can add two fields:&lt;BR /&gt;&lt;BR /&gt;if start date time is beyond 1730 then start date is invalid&lt;/P&gt;&lt;P&gt;if end date time is before 900 then end date is invalid&lt;/P&gt;&lt;P&gt;so in your expression's if statement you test if both indicator fields are VALID&lt;/P&gt;&lt;P&gt;you may need to test all possible scenarios&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jan 2021 00:59:19 GMT</pubDate>
    <dc:creator>edwin</dc:creator>
    <dc:date>2021-01-26T00:59:19Z</dc:date>
    <item>
      <title>WorkingHours excluding weekends and Consider working hours between 9 to 17:30</title>
      <link>https://community.qlik.com/t5/QlikView/WorkingHours-excluding-weekends-and-Consider-working-hours/m-p/1776880#M454932</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I hope you can help me on this!&lt;BR /&gt;I am creating a working hour field in the front end&amp;nbsp; which should exclude weekends and consider working hours between 09 to 17:30&lt;/P&gt;&lt;P&gt;Formula used is:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Interval(&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(RangeMin(Frac(EndDate), MakeTime(17,30,00))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- RangeMax(Frac(StartDate), MakeTime(09,00,00)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;+ (NetWorkDays(StartDate, EndDate-1) * MakeTime(08,30,00))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The above formula works perfectly fine if StartDate&amp;nbsp; time and EndDate time falls within 09 to 17:30 but it fails when&amp;nbsp;these times are outside working hours.&lt;/P&gt;&lt;P&gt;For instance:&lt;/P&gt;&lt;P&gt;StartDate:7/8/2020&amp;nbsp; 17:41:00&lt;/P&gt;&lt;P&gt;EndDate:7/8/2020&amp;nbsp; 18:03:49&lt;/P&gt;&lt;P&gt;Ideally as per the logic working hours for these dates should be 0 as they fall outside working hours but output I am getting is 23:49:00 which is wrong.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; &lt;/EM&gt;I have&amp;nbsp; gone through all the posts over community but nothing worked out and also I can't create these calculations in the script as StartDate and EndDate are from two different tables and they are connected via the fact table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me on this?&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Vidyarani&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:15:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/WorkingHours-excluding-weekends-and-Consider-working-hours/m-p/1776880#M454932</guid>
      <dc:creator>vidyarani</dc:creator>
      <dc:date>2024-11-15T23:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: WorkingHours excluding weekends and Consider working hours between 9 to 17:30</title>
      <link>https://community.qlik.com/t5/QlikView/WorkingHours-excluding-weekends-and-Consider-working-hours/m-p/1777295#M454970</link>
      <description>&lt;P&gt;maybe you can add an if statement if both start date and end dates are inside the valid time range.&amp;nbsp; since the fields are in separate tables, you can add two fields:&lt;BR /&gt;&lt;BR /&gt;if start date time is beyond 1730 then start date is invalid&lt;/P&gt;&lt;P&gt;if end date time is before 900 then end date is invalid&lt;/P&gt;&lt;P&gt;so in your expression's if statement you test if both indicator fields are VALID&lt;/P&gt;&lt;P&gt;you may need to test all possible scenarios&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 00:59:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/WorkingHours-excluding-weekends-and-Consider-working-hours/m-p/1777295#M454970</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-01-26T00:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: WorkingHours excluding weekends and Consider working hours between 9 to 17:30</title>
      <link>https://community.qlik.com/t5/QlikView/WorkingHours-excluding-weekends-and-Consider-working-hours/m-p/1777332#M454973</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/110947"&gt;@vidyarani&lt;/a&gt;, what is doing is:&lt;/P&gt;&lt;P&gt;- The rangemin gets 17:30&lt;/P&gt;&lt;P&gt;- The rangeMax gets 17:41&lt;/P&gt;&lt;P&gt;- The result is -11 minutes, I'm not sure why its shown as 23:49.&lt;/P&gt;&lt;P&gt;To solve this you can ad an if at start to check this case, like: If(Floor(StartDate)=Floor(EndDate) and&amp;nbsp;Frac(StartDate)&amp;gt;MakeTime(17,30,00), 0, `YourExpression])&lt;/P&gt;&lt;P&gt;Another posible solution would be add a RangeMin() to RangeMax() and viceversa, like:&lt;/P&gt;&lt;P&gt;- RangeMax(RangeMin(Frac(EndDate), MakeTime(17,30,00)), MakeTime(09,00,00))&lt;/P&gt;&lt;P&gt;-&amp;nbsp;RangeMin(RangeMax(Frac(StartDate), MakeTime(09,00,00)), MakeTime(17,30,00))&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 07:45:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/WorkingHours-excluding-weekends-and-Consider-working-hours/m-p/1777332#M454973</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-01-26T07:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: WorkingHours excluding weekends and Consider working hours between 9 to 17:30</title>
      <link>https://community.qlik.com/t5/QlikView/WorkingHours-excluding-weekends-and-Consider-working-hours/m-p/1780233#M455112</link>
      <description>&lt;P&gt;Hi Ruben,&lt;/P&gt;&lt;P&gt;Thank you so much for the response. Really appreciate it!&lt;/P&gt;&lt;P&gt;It works perfectly fine.&lt;/P&gt;&lt;P&gt;is it possible to implement same scenario in Script?&lt;/P&gt;&lt;P&gt;It would be great if you can share me the script.&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Vidyarani&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 14:51:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/WorkingHours-excluding-weekends-and-Consider-working-hours/m-p/1780233#M455112</guid>
      <dc:creator>vidyarani</dc:creator>
      <dc:date>2021-02-04T14:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: WorkingHours excluding weekends and Consider working hours between 9 to 17:30</title>
      <link>https://community.qlik.com/t5/QlikView/WorkingHours-excluding-weekends-and-Consider-working-hours/m-p/1780419#M455118</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/110947"&gt;@vidyarani&lt;/a&gt;, I think you can do exactly the same in script to have it in a new field. Can you try it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe you need to merge tables if StartDate and EndDate are in different tables&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 07:36:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/WorkingHours-excluding-weekends-and-Consider-working-hours/m-p/1780419#M455118</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-02-05T07:36:24Z</dc:date>
    </item>
  </channel>
</rss>

