<?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: Create 4 hour increments of time from start and end date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323349#M409717</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a variance in how times are calculated/rounded. See &lt;A href="http://qlikviewcookbook.com/2011/10/correct-time-arithmetic/" title="http://qlikviewcookbook.com/2011/10/correct-time-arithmetic/"&gt;Correct Time Arithmetic | Qlikview Cookbook&lt;/A&gt;.&amp;nbsp; I've tried various rounding tricks but the only reliable method I've found is to reinterpret with Timestamp#() as I show in the post. Here's how that works with your data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;TEST:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD *, RecNo() as RecId INLINE [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MemberID, StartTime, EndTime, Org, Role&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100, 10/19/2016 11:00:00 PM, 10/20/2016 11:00:00 AM, 1, 2000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100, 10/19/2016 07:00:00 AM, 10/19/2016 11:00:00 AM, 1, 2000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200, 10/18/2016 07:00:00 AM, 10/18/2016 07:00:00 PM, 2, 2500&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200, 10/20/2016 07:00:00 AM, 10/20/2016 11:00:00 AM, 2, 2500&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200, 10/20/2016 11:00:00 AM, 10/20/2016 07:00:00 PM, 3, 2500&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Expanded:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NoConcatenate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD RecId,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; MemberID,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; Timestamp(StartTime + interval#((IterNo()-1)*4, 'h')) as StartTime,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; Timestamp(StartTime + interval#((IterNo())*4, 'h')) as EndTime,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; Org,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; Role&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Resident TEST&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;While &lt;STRONG&gt;TimeStamp#(TimeStamp(StartTime + interval#((IterNo())*4, 'h'),'YYYYMMDDhhmmss'),'YYYYMMDDhhmmss')&lt;/STRONG&gt; &amp;lt;= EndTime&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;DROP TABLE TEST;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com" rel="nofollow" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 May 2017 15:26:46 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2017-05-11T15:26:46Z</dc:date>
    <item>
      <title>Create 4 hour increments of time from start and end date</title>
      <link>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323345#M409713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have attached an sample application. What i am trying to do is create 4 hour increments of time. If a row has a start time of 7:00 AM and an end time of 7:00 PM, I would like to create a row for 7a-11a then 11a-3p and so on until I hit 7:00PM. Below is the result I am trying to get from the attached application. Any help would be greatly appreciated. Thank you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 483px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="19" width="70"&gt;MemberID&lt;/TD&gt;&lt;TD width="159"&gt; StartTime&lt;/TD&gt;&lt;TD width="159"&gt; EndTime&lt;/TD&gt;&lt;TD width="31"&gt; Org&lt;/TD&gt;&lt;TD width="64"&gt; Role&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;100&lt;/TD&gt;&lt;TD&gt; 10/19/2016 11:00:00 PM&lt;/TD&gt;&lt;TD&gt; 10/20/2016 03:00:00 AM&lt;/TD&gt;&lt;TD align="right"&gt;1&lt;/TD&gt;&lt;TD align="right"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;100&lt;/TD&gt;&lt;TD&gt; 10/20/2016 03:00:00 AM&lt;/TD&gt;&lt;TD&gt; 10/20/2016 07:00:00 AM&lt;/TD&gt;&lt;TD align="right"&gt;1&lt;/TD&gt;&lt;TD align="right"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;100&lt;/TD&gt;&lt;TD&gt; 10/20/2016 07:00:00 AM&lt;/TD&gt;&lt;TD&gt; 10/20/2016 11:00:00 AM&lt;/TD&gt;&lt;TD align="right"&gt;1&lt;/TD&gt;&lt;TD align="right"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;100&lt;/TD&gt;&lt;TD&gt; 10/19/2016 07:00:00 AM&lt;/TD&gt;&lt;TD&gt; 10/19/2016 11:00:00 AM&lt;/TD&gt;&lt;TD align="right"&gt;1&lt;/TD&gt;&lt;TD align="right"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;200&lt;/TD&gt;&lt;TD&gt; 10/18/2016 07:00:00 AM&lt;/TD&gt;&lt;TD&gt; 10/18/2016 11:00:00 AM&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD align="right"&gt;2500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;200&lt;/TD&gt;&lt;TD&gt; 10/18/2016 11:00:00 AM&lt;/TD&gt;&lt;TD&gt; 10/18/2016 03:00:00 PM&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD align="right"&gt;2500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;200&lt;/TD&gt;&lt;TD&gt; 10/18/2016 03:00:00 PM&lt;/TD&gt;&lt;TD&gt; 10/18/2016 07:00:00 PM&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD align="right"&gt;2500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;200&lt;/TD&gt;&lt;TD&gt; 10/18/2016 07:00:00 PM&lt;/TD&gt;&lt;TD&gt; 10/18/2016 11:00:00 PM&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD align="right"&gt;2500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;200&lt;/TD&gt;&lt;TD&gt; 10/20/2016 07:00:00 AM&lt;/TD&gt;&lt;TD&gt; 10/20/2016 11:00:00 AM&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD align="right"&gt;2500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;200&lt;/TD&gt;&lt;TD&gt; 10/20/2016 11:00:00 AM&lt;/TD&gt;&lt;TD&gt; 10/20/2016 03:00:00 PM&lt;/TD&gt;&lt;TD align="right"&gt;3&lt;/TD&gt;&lt;TD align="right"&gt;2500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;200&lt;/TD&gt;&lt;TD&gt; 10/20/2016 03:00:00 PM&lt;/TD&gt;&lt;TD&gt; 10/20/2016 07:00:00 PM&lt;/TD&gt;&lt;TD align="right"&gt;3&lt;/TD&gt;&lt;TD align="right"&gt;2500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="19"&gt;200&lt;/TD&gt;&lt;TD&gt; 10/20/2016 07:00:00 PM&lt;/TD&gt;&lt;TD&gt; 10/20/2016 11:00:00 PM&lt;/TD&gt;&lt;TD align="right"&gt;3&lt;/TD&gt;&lt;TD align="right"&gt;2500&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 May 2017 20:33:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323345#M409713</guid>
      <dc:creator>tchovanec</dc:creator>
      <dc:date>2017-05-10T20:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Create 4 hour increments of time from start and end date</title>
      <link>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323346#M409714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Having personal edition so cannot view your file, I think below script can help - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source:&lt;/P&gt;&lt;P&gt;Load * inline [&lt;/P&gt;&lt;P&gt;MemberID, StartTime, EndTime,Org, Role&lt;/P&gt;&lt;P&gt;100, 10/19/2016 11:00:00 PM, 10/20/2016 11:00:00 AM, 1, 2000&lt;/P&gt;&lt;P&gt;100, 10/19/2016 07:00:00 AM, 10/19/2016 11:00:00 AM, 1, 2000&lt;/P&gt;&lt;P&gt;200, 10/18/2016 07:00:00 AM, 10/18/2016 11:00:00 PM, 2, 2500&lt;/P&gt;&lt;P&gt;200, 10/20/2016 07:00:00 AM, 10/20/2016 11:00:00 PM, 2, 2500&lt;/P&gt;&lt;P&gt;200, 10/20/2016 11:00:00 AM, 10/20/2016 03:00:00 PM, 3, 2500&lt;/P&gt;&lt;P&gt; ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Final:&lt;/P&gt;&lt;P&gt;Load MemberID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Iterno()&amp;gt;1 and (StartTime + 4*IterNo()/24)&amp;lt;=EndTime, Peek(EndTime),StartTime) as StartTime,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(StartTime + 4*IterNo()/24&amp;lt;=EndTime,TimeStamp(StartTime + 4*IterNo()/24),EndTime) as EndTime,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Org, Role&lt;/P&gt;&lt;P&gt;Resident Source&lt;/P&gt;&lt;P&gt;While StartTime + 4*IterNo()/24 &amp;lt;= EndTime;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Source;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2017 04:45:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323346#M409714</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2017-05-11T04:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create 4 hour increments of time from start and end date</title>
      <link>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323347#M409715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Digvijay, thank you for the response. It is very close to working, but for some reason the row below does &lt;SPAN style="font-size: 13.3333px;"&gt;not generate the 3:00 PM - 7:00 PM row&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Source:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Load * inline [&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MemberID, StartTime, EndTime,Org, Role&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;200, 10/20/2016 11:00:00 AM, 10/20/2016 07:00:00 PM, 3, 2500&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2017 11:21:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323347#M409715</guid>
      <dc:creator>tchovanec</dc:creator>
      <dc:date>2017-05-11T11:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create 4 hour increments of time from start and end date</title>
      <link>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323348#M409716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are right but bit strange, looks like they had difference in fraction of seconds internally. I now used floor in comparison so that they are compared up to the seconds precision. It now worked for me. Also simplified Start time line as we don't need other condition it seems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source:&lt;/P&gt;&lt;P&gt;Load * inline [&lt;/P&gt;&lt;P&gt;MemberID, StartTime, EndTime,Org, Role&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;100, 10/19/2016 11:00:00 PM, 10/20/2016 11:00:00 AM, 1, 2000&lt;/P&gt;&lt;P&gt;100, 10/19/2016 07:00:00 AM, 10/19/2016 11:00:00 AM, 1, 2000&lt;/P&gt;&lt;P&gt;200, 10/18/2016 07:00:00 AM, 10/18/2016 11:00:00 PM, 2, 2500&lt;/P&gt;&lt;P&gt;200, 10/20/2016 07:00:00 AM, 10/20/2016 11:00:00 PM, 2, 2500&lt;/P&gt;&lt;P&gt;200, 10/20/2016 11:00:00 AM, 10/20/2016 03:00:00 PM, 3, 2500&lt;/P&gt;&lt;P&gt;200, 10/20/2016 11:00:00 AM, 10/20/2016 07:00:00 PM, 3,&amp;nbsp; 2500&lt;/P&gt;&lt;P&gt; ];&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Final:&lt;/P&gt;&lt;P&gt;Load MemberID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Iterno()&amp;gt;1, Peek(EndTime),StartTime) as StartTime,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(StartTime + 4*IterNo()/24&amp;lt;=EndTime,TimeStamp(StartTime + 4*IterNo()/24),EndTime) as EndTime,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Org, Role&lt;/P&gt;&lt;P&gt;Resident Source&lt;/P&gt;&lt;P&gt;While floor(StartTime + 4*IterNo()/24,1/(24*60*60))&amp;lt;=floor(EndTime,1/(24*60*60));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Source;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2017 15:24:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323348#M409716</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2017-05-11T15:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Create 4 hour increments of time from start and end date</title>
      <link>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323349#M409717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a variance in how times are calculated/rounded. See &lt;A href="http://qlikviewcookbook.com/2011/10/correct-time-arithmetic/" title="http://qlikviewcookbook.com/2011/10/correct-time-arithmetic/"&gt;Correct Time Arithmetic | Qlikview Cookbook&lt;/A&gt;.&amp;nbsp; I've tried various rounding tricks but the only reliable method I've found is to reinterpret with Timestamp#() as I show in the post. Here's how that works with your data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;TEST:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD *, RecNo() as RecId INLINE [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MemberID, StartTime, EndTime, Org, Role&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100, 10/19/2016 11:00:00 PM, 10/20/2016 11:00:00 AM, 1, 2000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100, 10/19/2016 07:00:00 AM, 10/19/2016 11:00:00 AM, 1, 2000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200, 10/18/2016 07:00:00 AM, 10/18/2016 07:00:00 PM, 2, 2500&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200, 10/20/2016 07:00:00 AM, 10/20/2016 11:00:00 AM, 2, 2500&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200, 10/20/2016 11:00:00 AM, 10/20/2016 07:00:00 PM, 3, 2500&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Expanded:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NoConcatenate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD RecId,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; MemberID,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; Timestamp(StartTime + interval#((IterNo()-1)*4, 'h')) as StartTime,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; Timestamp(StartTime + interval#((IterNo())*4, 'h')) as EndTime,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; Org,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; Role&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Resident TEST&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;While &lt;STRONG&gt;TimeStamp#(TimeStamp(StartTime + interval#((IterNo())*4, 'h'),'YYYYMMDDhhmmss'),'YYYYMMDDhhmmss')&lt;/STRONG&gt; &amp;lt;= EndTime&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;DROP TABLE TEST;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com" rel="nofollow" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2017 15:26:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323349#M409717</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2017-05-11T15:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: Create 4 hour increments of time from start and end date</title>
      <link>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323350#M409718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great post, thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2018 16:06:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323350#M409718</guid>
      <dc:creator>james_butler</dc:creator>
      <dc:date>2018-10-30T16:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Create 4 hour increments of time from start and end date</title>
      <link>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323351#M409719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob and Digvijay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've worked both of your methods through and I'm getting the same result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather than 4 hourly, my data set meets to be hourly so I have amended my script to be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Iterno script.PNG" class="jive-image image-1" src="/legacyfs/online/217210_Iterno script.PNG" style="height: 168px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the front end I am summing up "Carparkprebooking Car Count".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some reason the expression works for every 3 hours but not for the 2 hours in between.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example 00:00 = 112 which is correct&lt;/P&gt;&lt;P&gt;But at 01:00 I've got 32 and 80. Added together they are correct but I can't figure out why I've got&amp;nbsp; two timestamps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Iterno chart.PNG" class="jive-image image-2" src="/legacyfs/online/217220_Iterno chart.PNG" style="height: 219px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2018 16:02:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323351#M409719</guid>
      <dc:creator>james_butler</dc:creator>
      <dc:date>2018-10-31T16:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create 4 hour increments of time from start and end date</title>
      <link>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323352#M409720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It would be good to start a new thread with some sample data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2018 16:31:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323352#M409720</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2018-10-31T16:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Create 4 hour increments of time from start and end date</title>
      <link>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323353#M409721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Done&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/318641"&gt;Using IterNo() to create hourly increments&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2018 13:31:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323353#M409721</guid>
      <dc:creator>james_butler</dc:creator>
      <dc:date>2018-11-01T13:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create 4 hour increments of time from start and end date</title>
      <link>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323354#M409722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2018 13:31:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-4-hour-increments-of-time-from-start-and-end-date/m-p/1323354#M409722</guid>
      <dc:creator>james_butler</dc:creator>
      <dc:date>2018-11-01T13:31:19Z</dc:date>
    </item>
  </channel>
</rss>

