<?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: Daystart function not working as expected in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Daystart-function-not-working-as-expected/m-p/461619#M172374</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, that worked well. (using floor(IncLeadDate)+.375)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still don't understand, though - there's nothing in the documentation that says "daystart()" considers times before 9 am to be the previous day, and the function works fine when I'm using it to adjust leads that come in on Saturday or Sunday to calculate as if the lead came in Monday at 9 am. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But problem solved, so thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Mar 2013 18:47:42 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-03-20T18:47:42Z</dc:date>
    <item>
      <title>Daystart function not working as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Daystart-function-not-working-as-expected/m-p/461617#M172372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Further to my issue with trying to calculate the time between a lead being received, and it being processed, I had to devise a way to deal with zealous Admins who came in before 9 am to catch up on their work. I thought this would work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AdjustedLeadDate = if(hour(IncLeadDate)&amp;lt;9,daystart(IncLeadDate,0,.375),IncLeadDate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would set all the incoming leads that came in early to 9:00 AM, and those that came in after 9 AM to their actual time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I put this in my report, I would get the following results:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IncLeadDate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AdjustedLeadDate&lt;/P&gt;&lt;P&gt;&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; &lt;/P&gt;&lt;P&gt;3/15/13 8:38 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3/14/13 9:00 AM&amp;nbsp;&amp;nbsp; &amp;lt;-- Note the date is adjusted to previous day, even though shift is zero&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I thought maybe the documentation was incorrect, and I had to put in daystart(IncLeadDate,1,.375). But when I did that, &lt;/P&gt;&lt;P&gt;I got:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IncLeadDate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AdjustedLeadDate&lt;/P&gt;&lt;P&gt;&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; &lt;/P&gt;&lt;P&gt;3/15/13 8:38 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3/16/13 9:00 AM &amp;lt;-- Note the date is adjusted to next day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 18:26:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Daystart-function-not-working-as-expected/m-p/461617#M172372</guid>
      <dc:creator />
      <dc:date>2013-03-20T18:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Daystart function not working as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Daystart-function-not-working-as-expected/m-p/461618#M172373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I understand it if you set the start of the day to 9:00 AM then times before that day fall in the previous day. The daystart of such datetimes would be 9:00 AM the previous day. That doesn't explain why you get 3/16/9:00 AM if you use an offset of 1 day. I haven't been able to reproduce that here. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively you could try:&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;if(hour(IncLeadDate)&amp;lt;9,floor(IncLeadDate) + 0.375,IncLeadDate)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 18:37:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Daystart-function-not-working-as-expected/m-p/461618#M172373</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-03-20T18:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Daystart function not working as expected</title>
      <link>https://community.qlik.com/t5/QlikView/Daystart-function-not-working-as-expected/m-p/461619#M172374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, that worked well. (using floor(IncLeadDate)+.375)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still don't understand, though - there's nothing in the documentation that says "daystart()" considers times before 9 am to be the previous day, and the function works fine when I'm using it to adjust leads that come in on Saturday or Sunday to calculate as if the lead came in Monday at 9 am. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But problem solved, so thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 18:47:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Daystart-function-not-working-as-expected/m-p/461619#M172374</guid>
      <dc:creator />
      <dc:date>2013-03-20T18:47:42Z</dc:date>
    </item>
  </channel>
</rss>

