<?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: how to calculate days between two timestamps in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041128#M350376</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lokesh, you can try something like:&lt;/P&gt;&lt;P&gt;NetWorkDays(OrderDate, Alt(DeliveryDate, Today()), PublicHolidayDate)&lt;/P&gt;&lt;P&gt;+ If(Frac(Time(OrderDate))&amp;gt;0.5, -1, 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the sample provided the OrderDate is not really a Date, it's a string and it should be a Date. And also the PublicHolidayDate doesn't exists--&amp;gt; It's is 31/04 and april has 30 days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the only Order with DeliveryDate has it's DeliveryDate lower than OrderDate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it works with real data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Apr 2016 17:00:06 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2016-04-05T17:00:06Z</dc:date>
    <item>
      <title>how to calculate days between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041125#M350373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0 0 1em;"&gt;&lt;SPAN style="color: #000000;"&gt;Hi guys,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em;"&gt;&lt;SPAN style="color: #ff6600;"&gt;&lt;STRONG&gt;What am I trying to achieve?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em;"&gt;I want to calculate following two types of total days between two &lt;STRONG&gt;timestamp fields&lt;/STRONG&gt;.&lt;/P&gt;&lt;OL style="margin: 0 0 1em 30px;"&gt;&lt;LI&gt;Number of Working Days (Excluding Weekend &amp;amp; Public Holidays)&lt;/LI&gt;&lt;LI&gt;Number of Total Days (Including Weekend &amp;amp; Public Holidays)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style="color: #339966; margin: 0 0 1em;"&gt;&lt;STRONG&gt;Calculation Condition&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If OrderDate time is &amp;lt;= 12:00 PM then start count from 0&lt;/LI&gt;&lt;LI&gt;If OrderDate Time is &amp;gt; 12:00 PM then start count from -1&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count day from Order Date till Delivery Date but&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;if Delivery Date is NULL then count till Today's date&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="margin: 0 0 1em;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; margin: 0 0 1em;"&gt;&lt;STRONG&gt;Data Model&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;[OrderDate]&lt;/EM&gt; &amp;amp; [&lt;EM&gt;DeliveryDate]&lt;/EM&gt; resides in same '&lt;EM&gt;OrderTable&lt;/EM&gt;'&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;[PublicHolidayDate]&lt;/EM&gt; resides in separate '&lt;EM&gt;PublicHolidaysTable&lt;/EM&gt;'&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Apr 2016 03:42:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041125#M350373</guid>
      <dc:creator />
      <dc:date>2016-04-02T03:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate days between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041126#M350374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you share few rows of data with expected output? Usually the best possible way to get help is to provide these two things (+ the logic, if the logic for output in not straight forward) and you will be amazed how quickly you get responses.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Apr 2016 10:49:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041126#M350374</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-03T10:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate days between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041127#M350375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;HI Sunny&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px; line-height: 1.5em;"&gt;Thank you for the advice, I will follow your instructions in my future posts &lt;/SPAN&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;I have uploaded a sample QVD in the original discussion of this post.. . Your time and help will be highly appreciated.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Apr 2016 11:28:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041127#M350375</guid>
      <dc:creator />
      <dc:date>2016-04-03T11:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate days between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041128#M350376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lokesh, you can try something like:&lt;/P&gt;&lt;P&gt;NetWorkDays(OrderDate, Alt(DeliveryDate, Today()), PublicHolidayDate)&lt;/P&gt;&lt;P&gt;+ If(Frac(Time(OrderDate))&amp;gt;0.5, -1, 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the sample provided the OrderDate is not really a Date, it's a string and it should be a Date. And also the PublicHolidayDate doesn't exists--&amp;gt; It's is 31/04 and april has 30 days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the only Order with DeliveryDate has it's DeliveryDate lower than OrderDate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it works with real data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2016 17:00:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041128#M350376</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2016-04-05T17:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate days between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041129#M350377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lokesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case the bank holidays needs to be a comma separated list of bank holiday dates, like this:&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; font-size: 13px;"&gt;&lt;STRONG&gt;NetWorkDays(OrderDate, Alt(DeliveryDate, Today()), '01/01/2016','25/03/2016','28/03/2016')&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It would be best to get the bank holidays from a file, rather than have to key them in, so you would want something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Temp_Hols:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Holiday&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM HolidayDates.xls&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(...format specifier etc...);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let vHols = '';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;for iHol = 0 to NoOfRows('Temp_Hols') -1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; let vHols = vHols &amp;amp; if(iHol &amp;gt; 0, ',', '') &amp;amp; chr(39) &amp;amp; Date(peek('Holiday', iHol, 'Temp_Hols')) &amp;amp; chr(39);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;next&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP TABLE Temp_Hols;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; OrderDate,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; DeliveryDate,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp; NetWorkDays(OrderDate, Alt(DeliveryDate, Today()), $(vHols)) as [Working Days],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Alt(DeliveryDate, Today()) - OrderDate as [Total Days],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FROM ...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've just typed this code directly into the thread, so there are likely to be syntax errors - but it should point you in the right direction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2016 17:16:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041129#M350377</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2016-04-05T17:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate days between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041130#M350378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thanks for correcting me Steve, I never have to use that function. Good to know if one day I find the need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking in a chart solution, in that case I update my previous expression to:&lt;/P&gt;&lt;P&gt;NetWorkDays(OrderDate_Date, Alt(DeliveryDate, Today()), '$(=Concat(PublicHolidayDate, Chr(39) &amp;amp; ',' &amp;amp; Chr(39)))')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...But it can be improved creating the variable in script as Steve says and then use it in the expression:&lt;/P&gt;&lt;P&gt;NetWorkDays(OrderDate_Date, Alt(DeliveryDate, Today()), $(vHols))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...But the option to have the values calculated in the script proposed by Steve is the best choice. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/laugh.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2016 18:18:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041130#M350378</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2016-04-05T18:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate days between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041131#M350379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stevan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your reply and sorry for messed up sample QVW..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried your Technic but it is not giving me desired result. It is giving me one extra day in the resut.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached a zip file with another sample QVW with sample QVD file with expected result and it would be great if you can have a look on holiday variable i created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 05:57:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041131#M350379</guid>
      <dc:creator />
      <dc:date>2016-04-06T05:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate days between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041132#M350380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ruben,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have adjusted ( + / - )&amp;nbsp; the dates in SQL before creating QVD to make it simpler.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached another ZIP file with better sample QVW and QVD thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 06:00:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041132#M350380</guid>
      <dc:creator />
      <dc:date>2016-04-06T06:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate days between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041133#M350381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lokesh&lt;/P&gt;&lt;P&gt;One suggestion - &lt;/P&gt;&lt;P&gt;If your using SQL to generate QVD then do all this calculation SQL itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL having standard functions available for this, and it will not increase any load on your qvd.Data processing will be faster if you handle in script itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lokesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 06:51:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041133#M350381</guid>
      <dc:creator />
      <dc:date>2016-04-06T06:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate days between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041134#M350382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the tip Lokesh S,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wouldn't it make SQL query slow ? when performing incremental load?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and what i think SQL query will be more complex then qlikview? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 07:01:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041134#M350382</guid>
      <dc:creator />
      <dc:date>2016-04-06T07:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate days between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041135#M350383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lokesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per your requirement SQL work faster.&lt;/P&gt;&lt;P&gt;In SQL you can use group by, ROLLUP and one month parameter.&lt;/P&gt;&lt;P&gt;I guess SQL will take some fraction of seconds to retrieve your required data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Qlikview if you add those calculation in expressions then it will get slower as time goes on because of data load incremental.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This i observed in my daily practice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lokesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 07:22:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041135#M350383</guid>
      <dc:creator />
      <dc:date>2016-04-06T07:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate days between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041136#M350384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lokesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dates in QlikView (as in Excel and SQL etc.) are simply numbers that look a bit different.&amp;nbsp; A whole day is an integer, i.e. 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are consistently one day out then you can simply do a -1 to fix it up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;NetWorkDays(OrderDate, Alt(DeliveryDate, Today()), $(vHols)) - 1 as [Working Days],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 07:26:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041136#M350384</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2016-04-06T07:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate days between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041137#M350385</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;I'm not sure if SQL has a function as flexible as the QlikView NetworkDays function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not going to be a heavy calculation, so it doesn't matter too much where it is done from that point of view - but personally I would always tend to do it on the QlikView side.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you mention if you have a decent incremental load into QVDs then it only needs to be re-calculated when any given row changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 07:34:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041137#M350385</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2016-04-06T07:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate days between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041138#M350386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note also...&amp;nbsp; I didn't include the midday calculation, as you could take that from &lt;A href="https://community.qlik.com/qlik-users/21969"&gt;RubenMarin&lt;/A&gt;‌ 's solution above:&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; font-size: 13px;"&gt;&lt;STRONG&gt;+ If(Frac(Time(OrderDate))&amp;gt;0.5, -1, 0)&lt;/STRONG&gt;&lt;/SPAN&gt;&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; font-size: 13px;"&gt;It may be that you require this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;NetWorkDays(OrderDate, Alt(DeliveryDate, Today()), $(vHols)) &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;+ If(Frac(Time(OrderDate))&amp;gt;0.5, -1, 0)&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;as [Working Days],&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Steve&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 07:37:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041138#M350386</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2016-04-06T07:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate days between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041139#M350387</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;Thanks for advice.. The order table QVD gets updated every 30 minutes with modified records and on average its around 250 records each incremental load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached a QVW and QVD in a zip file with your Holiday variable formula but its varying by one extra day from desired outcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would you please have a look on my QVW if you get a change?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 07:59:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041139#M350387</guid>
      <dc:creator />
      <dc:date>2016-04-06T07:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate days between two timestamps</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041140#M350388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you not just -1 at the end of the expression?&amp;nbsp; NetworkDays includes both the start and end days, and it sounds like you need to count only one end or the other?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 17:14:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-calculate-days-between-two-timestamps/m-p/1041140#M350388</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2016-04-06T17:14:20Z</dc:date>
    </item>
  </channel>
</rss>

