<?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: Time Intervals in a day in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905372#M1016717</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;That is called Preceding Load, you can find this type of tips and scripting in Qlikview Reference Manual PDF or you can purchase Qlikview 11 for Developers book.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Apr 2015 06:17:22 GMT</pubDate>
    <dc:creator>jagan</dc:creator>
    <dc:date>2015-04-15T06:17:22Z</dc:date>
    <item>
      <title>Time Intervals in a day</title>
      <link>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905364#M1016704</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;Rather new to QlikView here, and I've tried to search for solutions on the community but am unable to find any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a data file with transactional data in the following format:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/83578_Capture.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;I would like to have a table in QV that lists the sales time in intervals:&lt;/P&gt;&lt;P&gt;e.g. &lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture2.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/83585_Capture2.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How should I go about doing this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've currently copied a code from another community page:&lt;/P&gt;&lt;P&gt;Dual(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Interval(SubField(Class([Sale Time], 1/24),'&amp;lt;= x &amp;lt;',1),'HH:mm')&amp;amp;' - '&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Interval(SubField(Class([Sale Time], 1/24),'&amp;lt;= x &amp;lt;',2),'HH:mm'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Class([Sale Time], 1/24)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) as [Sale Time Period]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when I viewed the data in QlikView, I'm getting the following:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture3.JPG" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/83586_Capture3.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So obviously I'm missing out something here as the Sale Time is not linked to the correct time period. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would appreciate it if anyone is able to point me in the right direction!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2015 06:01:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905364#M1016704</guid>
      <dc:creator />
      <dc:date>2015-04-14T06:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Time Intervals in a day</title>
      <link>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905365#M1016706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you just need to display it, this simple expression should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Hour([Sale Time]) &amp;amp; ':00-' &amp;amp; Hour([Sale Time]) &amp;amp; ':59' As [Sale Time Period]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to add a bucket for all possible time periods, add this table as well:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SaleTimePeriods:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; Num(RecNo()-1,'##') &amp;amp; ':00-' &amp;amp; Num(RecNo()-1,'##') &amp;amp; ':59' As [Sale Time Period] &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Autogenerate 24;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2015 09:21:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905365#M1016706</guid>
      <dc:creator>Ralf-Narfeldt</dc:creator>
      <dc:date>2015-04-14T09:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Time Intervals in a day</title>
      <link>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905366#M1016707</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;&lt;/P&gt;&lt;P&gt;Try like this in script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;Hour([Sale Time]) &amp;amp; ':00-' &amp;amp; Hour([Sale Time]) + 1 &amp;amp; ':00' As [Sale Time Period]&lt;/P&gt;&lt;P&gt;FROM DataSource;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2015 09:50:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905366#M1016707</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-04-14T09:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Time Intervals in a day</title>
      <link>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905367#M1016709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ralf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried adding your script as mentioned (kindly see attached).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The top chart and list box were created using the script I mentioned in my original post, while the bottom chart and list box was obtained from your script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see, the bottom chart and list box do not list the data correctly, nor do they update correctly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will it be possible to take a look at the script and see what I'd done wrong? Your help is much appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2015 01:29:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905367#M1016709</guid>
      <dc:creator />
      <dc:date>2015-04-15T01:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Time Intervals in a day</title>
      <link>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905368#M1016711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You are joining the Transaction Data and Transaction Date tables based on the Date but it should be joined based on time also.&amp;nbsp; You can solve this by using the below script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Transaction Data]:&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;LOAD *,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; Year([Sale Date]) as [Sale Year],&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; MONTH([Sale Date]) as [Sale Month],&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; DAY([Sale Date]) as [Sale Day],&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; Hour([Sale Time]) &amp;amp; ':00-' &amp;amp; Hour([Sale Time]) &amp;amp; ':59' As [Sale Time Period];&lt;/P&gt;&lt;P&gt;LOAD TXN_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date(Date#(left(TXN_ID,8),'YYYYMMDD'),'DD/MM/YYYY') as [Sale Date], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TXN_CODE, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SALES_DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(Date#(right(SALES_DATE,5),'hh:mm'),'hh:mm') as [Sale Time],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PATRON_ID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CHANNEL_TYPE, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REFERENCED_TXN_ID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRODUCT_ID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TICKETS_SOLD, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAYMENT_METHOD, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAID_AMT, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; POS_ALIAS&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(biff, embedded labels, table is [Export Worksheet$]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2015 02:24:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905368#M1016711</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-04-15T02:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Time Intervals in a day</title>
      <link>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905369#M1016712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jagan's solution looks about right, can't verify without source data files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2015 05:18:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905369#M1016712</guid>
      <dc:creator>Ralf-Narfeldt</dc:creator>
      <dc:date>2015-04-15T05:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Time Intervals in a day</title>
      <link>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905370#M1016714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jagan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried your code and it works perfect. Thanks for the help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I have no programming background, I'm not too sure how the scripting works, shouldn't it load the top "Load *" statement first before the bottom "Load" statement? Is there any documentation anywhere that can point me in the right direction?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2015 06:06:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905370#M1016714</guid>
      <dc:creator />
      <dc:date>2015-04-15T06:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Time Intervals in a day</title>
      <link>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905371#M1016715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a preceding LOAD, a great feature. HIC has written most of what you need to know in this blog post:&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2972"&gt;Preceding Load&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2015 06:10:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905371#M1016715</guid>
      <dc:creator>Ralf-Narfeldt</dc:creator>
      <dc:date>2015-04-15T06:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Time Intervals in a day</title>
      <link>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905372#M1016717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;That is called Preceding Load, you can find this type of tips and scripting in Qlikview Reference Manual PDF or you can purchase Qlikview 11 for Developers book.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2015 06:17:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Time-Intervals-in-a-day/m-p/905372#M1016717</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-04-15T06:17:22Z</dc:date>
    </item>
  </channel>
</rss>

