<?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 Autogenerating Time Intervals In Day in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149549#M27715</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this, perhaps:&lt;/P&gt;&lt;P&gt;Calendar:&lt;BR /&gt;LOAD date(daystart($(varmindate)+(recno()-1)/96)) as Date&lt;BR /&gt; , time( frac($(varmindate)+(recno()-1)/96)) as Time&lt;BR /&gt;AUTOGENERATE ($(varmaxdate)-$(varmindate)+1)*96;&lt;/P&gt;&lt;P&gt;Edit: Looks like I forgot to tell QlikView to format these as date and time fields. I could do that in the properties, but I usually do it in the script. Corrected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Jul 2009 03:22:08 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2009-07-17T03:22:08Z</dc:date>
    <item>
      <title>Autogenerating Time Intervals In Day</title>
      <link>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149544#M27710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am having trouble getting the autogenerate function to work with time to create in intraday table.&lt;/P&gt;&lt;P&gt;I would like to generate dates, then times within each date so that i can build a fact table based on the time and day as a key, i have the date one working fine but the intraday times (15 minute intervals from 7 am to 10pm) i cant seem to get them to autogenerate and then allocate to each day in the previous autogenerate for the dates:&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated as i think its quite simple to do but just cant seem to get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code that i think should run and give me what im looking for but it only picks up the innital interval of 07:00 and doesnt autogenerate the full day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LET varmindate = peek('schedDate',0,'raw');&lt;BR /&gt;LET varmaxdate = peek('schedDate',-1,'raw');&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;tempcalender:&lt;BR /&gt;load&lt;BR /&gt;date('$(varmindate)' + iterno()-1) as date&lt;BR /&gt;autogenerate 1 while '$(varmindate)' + iterno()-1 &amp;lt;= '$(varmaxdate)';&lt;BR /&gt;&lt;BR /&gt;let varmintime = time('07:00:00','hh:mm');&lt;BR /&gt;let varmaxtime = time('22:00:00','hh:mm');&lt;BR /&gt;&lt;BR /&gt;time_temp:&lt;BR /&gt;load&lt;BR /&gt;time('$(varmintime)' + iterno()-1) as int&lt;BR /&gt;autogenerate 1 while '$(varmintime)' + iterno()-1 &amp;lt;= '$(varmaxtime)';&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In effect what im looking to do is create&lt;/P&gt;&lt;P&gt;Date , int&lt;/P&gt;&lt;P&gt;27/07/2009, 07:00&lt;/P&gt;&lt;P&gt;27/07/2009, 07:15&lt;/P&gt;&lt;P&gt;27/07/2009, 07:30&lt;/P&gt;&lt;P&gt;etc for each day in the first autogenerate statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2009 20:17:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149544#M27710</guid>
      <dc:creator>paulferguson80</dc:creator>
      <dc:date>2009-07-16T20:17:03Z</dc:date>
    </item>
    <item>
      <title>Autogenerating Time Intervals In Day</title>
      <link>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149545#M27711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;Replace :&lt;/P&gt;&lt;P&gt;time('$(varmintime)' + iterno()-1) as int&lt;/P&gt;&lt;P&gt;with&lt;/P&gt;&lt;P&gt;time(time('07:00:00','hh:mm') + time('00:'&amp;amp;15 * iterno() &amp;amp;':00','hh:mm')) as int&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2009 21:10:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149545#M27711</guid>
      <dc:creator />
      <dc:date>2009-07-16T21:10:23Z</dc:date>
    </item>
    <item>
      <title>Autogenerating Time Intervals In Day</title>
      <link>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149546#M27712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is probably not the best solution, but it shows the versatility of QlikView ito problem solving:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET varmindate = peek(today());&lt;BR /&gt;//LET varmaxdate = peek('schedDate',-1,'raw');&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;tempcalender:&lt;BR /&gt;load&lt;BR /&gt; rowno() as row,&lt;BR /&gt; makedate(year(today()),month(today()),day(today()+rowno())) as date&lt;BR /&gt;autogenerate 12;// while '$(varmindate)' + iterno()-1 &amp;lt;= '$(varmaxdate)';&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;LEFT JOIN&lt;BR /&gt;&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; HOUR&lt;BR /&gt; 7&lt;BR /&gt; 8&lt;BR /&gt; 9&lt;BR /&gt; 10&lt;BR /&gt; 11&lt;BR /&gt; 12&lt;BR /&gt; 13&lt;BR /&gt; 14&lt;BR /&gt; 15&lt;BR /&gt; 16&lt;BR /&gt; 17&lt;BR /&gt; 18&lt;BR /&gt; 19&lt;BR /&gt; 20&lt;BR /&gt; 21&lt;BR /&gt; 22&lt;BR /&gt;];&lt;BR /&gt;LEFT JOIN&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; Minute&lt;BR /&gt; 15&lt;BR /&gt; 30&lt;BR /&gt; 45&lt;BR /&gt; 00&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;[final]:&lt;BR /&gt;noconcatenate&lt;BR /&gt;LOAD *,&lt;BR /&gt; HOUR &amp;amp; ':' &amp;amp; Minute AS INTERVAL&lt;BR /&gt;RESIDENT tempcalender;&lt;BR /&gt;&lt;BR /&gt;DROP TABLE tempcalender;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2009 21:26:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149546#M27712</guid>
      <dc:creator />
      <dc:date>2009-07-16T21:26:04Z</dc:date>
    </item>
    <item>
      <title>Autogenerating Time Intervals In Day</title>
      <link>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149547#M27713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abdul&lt;/P&gt;&lt;P&gt;Thank you for your response, it still doesnt seem to autogenerate the rest of the day?&lt;/P&gt;&lt;P&gt;I now get only the one interval of 07:15 as oppose to the original 07:00&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2009 21:42:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149547#M27713</guid>
      <dc:creator>paulferguson80</dc:creator>
      <dc:date>2009-07-16T21:42:18Z</dc:date>
    </item>
    <item>
      <title>Autogenerating Time Intervals In Day</title>
      <link>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149548#M27714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wern&lt;/P&gt;&lt;P&gt;Thanks for this solution &lt;IMG alt="Smile" src="http://community.qlik.com/emoticons/emotion-1.gif" /&gt;&lt;/P&gt;&lt;P&gt;This does give the desired effect and i have used the innital code to make it run between the dates that i need the table from and to so solves the problem that i have, so thanks for this it will certainly get me back on my way.&lt;/P&gt;&lt;P&gt;I am still interested in how to get the autogenerate to do this too as im sure it can be done, i will post it if i can get it to do it for future ref.&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2009 21:48:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149548#M27714</guid>
      <dc:creator>paulferguson80</dc:creator>
      <dc:date>2009-07-16T21:48:24Z</dc:date>
    </item>
    <item>
      <title>Autogenerating Time Intervals In Day</title>
      <link>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149549#M27715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this, perhaps:&lt;/P&gt;&lt;P&gt;Calendar:&lt;BR /&gt;LOAD date(daystart($(varmindate)+(recno()-1)/96)) as Date&lt;BR /&gt; , time( frac($(varmindate)+(recno()-1)/96)) as Time&lt;BR /&gt;AUTOGENERATE ($(varmaxdate)-$(varmindate)+1)*96;&lt;/P&gt;&lt;P&gt;Edit: Looks like I forgot to tell QlikView to format these as date and time fields. I could do that in the properties, but I usually do it in the script. Corrected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2009 03:22:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149549#M27715</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-07-17T03:22:08Z</dc:date>
    </item>
    <item>
      <title>Autogenerating Time Intervals In Day</title>
      <link>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149550#M27716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a variation on an example from the QV Cookbook:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LET vEndDate = num(today(1)); // End at today's date&lt;BR /&gt;LET vStartDate = $(vEndDate)-60; // Last 60 days&lt;BR /&gt;FOR t = MakeTime(7) to MakeTime(20) STEP MakeTime(0,15)&lt;BR /&gt; DateMaster:&lt;BR /&gt; LOAD&lt;BR /&gt; date($(vStartDate) + IterNo()) as Date,&lt;BR /&gt; time($(t)) as Time&lt;BR /&gt; AUTOGENERATE 1&lt;BR /&gt; WHILE $(vStartDate) + IterNo() &amp;lt;= $(vEndDate)&lt;BR /&gt; ;&lt;BR /&gt;NEXT t&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2009 06:09:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149550#M27716</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-07-17T06:09:50Z</dc:date>
    </item>
    <item>
      <title>Autogenerating Time Intervals In Day</title>
      <link>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149551#M27717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;I know it was a while ago that you posted, i am just revisiting the process to try and refine and improve the process.&lt;/P&gt;&lt;P&gt;The code you posted looked to be the elegant replacement for the current inline loads and will work dynamically with the other code in the load script for the calendar that we have put together, the only problem is that when testing the code i found that the 15 minute incraments works excellently, however i need to interval match the time at seconds level.&lt;/P&gt;&lt;P&gt;So i have changed the STEP (0,15) to STEP(0,1)&lt;/P&gt;&lt;P&gt;This works up until 14:50:00 and then we loose a second?&lt;/P&gt;&lt;P&gt;The next time is 14:50:59&lt;/P&gt;&lt;P&gt;Im not clear as to why this happens at this time of the day but it seems to happen over all of the dates at the same time of day?&lt;/P&gt;&lt;P&gt;Can you shed any light on this problem?&lt;/P&gt;&lt;P&gt;I am running QV9 SR6 and have tried on both 32 and 64 bits thinking its service release problem, i have also run on SR1 to check this and the results dont change?&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;&lt;P&gt;Paul Ferguson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 12:13:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149551#M27717</guid>
      <dc:creator>paulferguson80</dc:creator>
      <dc:date>2011-01-10T12:13:15Z</dc:date>
    </item>
    <item>
      <title>Autogenerating Time Intervals In Day</title>
      <link>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149552#M27718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;The second is lost due to a limitation of precision when adding in the minute (1440/1) value. The MakeTime(0,1) is a decimal value that's close, but not exactly 1440/1. The imprecision eventually catches up. A more accurate solution is to generate the time values using discrete numbers in the loop like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vEndDate = num(today(1)); // End at today's date&lt;/P&gt;&lt;P&gt;LET vStartDate = $(vEndDate)-60; // Last 60 days&lt;/P&gt;&lt;P&gt;FOR vHour = 7 TO 20&lt;/P&gt;&lt;P&gt;FOR vMinute = 0 TO 59&lt;/P&gt;&lt;P&gt;DateMaster:&lt;BR /&gt; LOAD&lt;BR /&gt; date($(vStartDate) + IterNo()) as Date,&lt;BR /&gt; MakeTime($(vHour), $(vMinute)) as Time&lt;BR /&gt; AUTOGENERATE 1&lt;BR /&gt; WHILE $(vStartDate) + IterNo() &amp;lt;= $(vEndDate);&lt;/P&gt;&lt;P&gt;NEXT vMinute&lt;/P&gt;&lt;P&gt;NEXT vHour&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jan 2011 21:15:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Autogenerating-Time-Intervals-In-Day/m-p/149552#M27718</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2011-01-14T21:15:01Z</dc:date>
    </item>
  </channel>
</rss>

