<?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: Reworking a code in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Reworking-a-code/m-p/674464#M674631</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IntervalMatch would be a little simpler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Jul 2014 12:50:02 GMT</pubDate>
    <dc:creator>marcus_malinow</dc:creator>
    <dc:date>2014-07-29T12:50:02Z</dc:date>
    <item>
      <title>Reworking a code</title>
      <link>https://community.qlik.com/t5/QlikView/Reworking-a-code/m-p/674463#M674630</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 have a piece of code that does roughly the following:&lt;/P&gt;&lt;P&gt;- Target values per day, shift (there are 2) and dpt. are loaded from a file;&lt;/P&gt;&lt;P&gt;- Minute_intervals are created from 05:20 (beginning of a working day) till 22:30 (end of a working day)&lt;/P&gt;&lt;P&gt;- They are joined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The important point for now is: The code now generates time_intervals which we move towards - so the intervals are always in the future, so to speak. It looks like this:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;if(Interval_Min&amp;lt;730,'07:30', if(Interval_Min&amp;lt;1000,'10:00', if(Interval_Min&amp;lt;1200,'12:00', if(Interval_Min&amp;lt;1400,'14:00',&lt;BR /&gt;if(Interval_Min&amp;lt;1600,'16:00', if(Interval_Min&amp;lt;1830,'18:30', if(Interval_Min&amp;lt;2030,'20:30', if(Interval_Min&amp;lt;2230,'22:30','22:30')))))))) as Interval_2H,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field Interval_Min has every minute of the day between the start- and end-times. These are not real timestamps of course, by now I have those, but that is not the point - this kind of nested IF-constructs is not quite my idea of efficiency. So would there be any other, slimmer way of doing this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 12:46:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reworking-a-code/m-p/674463#M674630</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-07-29T12:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Reworking a code</title>
      <link>https://community.qlik.com/t5/QlikView/Reworking-a-code/m-p/674464#M674631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IntervalMatch would be a little simpler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 12:50:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reworking-a-code/m-p/674464#M674631</guid>
      <dc:creator>marcus_malinow</dc:creator>
      <dc:date>2014-07-29T12:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Reworking a code</title>
      <link>https://community.qlik.com/t5/QlikView/Reworking-a-code/m-p/674465#M674632</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;now I have another issue:&lt;/P&gt;&lt;P&gt;A new piece of code that I have introduced in this script now autogenerates "real" minutes (60 to an hour) between 5:20 am and 10:30 pm.&lt;/P&gt;&lt;P&gt;&amp;lt;=&amp;gt; For one field (&amp;gt;interval_hr&amp;lt;) in the code following this, I need to split out the hours:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- One "2hr-interval" during the day is 10am, the next is 12am&lt;/P&gt;&lt;P&gt;=&amp;gt; The minute-intervals I have inbetween there are all from 10:01 to 11:59&lt;/P&gt;&lt;P&gt;=&amp;gt; The hr-intervals should be 11 and 12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to split out the hour-part now from the minute-intervals (if I could do this, then just adding 1 would be enough)&lt;/P&gt;&lt;P&gt;Here is the code that generates these intervals:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;SET &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;vShiftStart&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;=Time#('5:20:00');&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;Set&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;vShiftEnd=&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;Time#('22:30:00');&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Time&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;$(vShiftStart)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; + &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Time#&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;('00:01:00')*(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;IterNo&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;()-1), 'hh:mm') &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;Interval_Min&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;AutoGenerate&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; (1)&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;While&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Time&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;$(vShiftStart)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; + &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Time#&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;('00:01:00')*(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;IterNo&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;()-1), 'hh:mm') &amp;lt;= &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;$(vShiftEnd)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;BR /&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I tried the Hour() function, but then I'd end up with the "hour-intervals" 11, 12 and 13. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Can anyone help me here?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks a lot!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;DataNibbler&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 13:07:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reworking-a-code/m-p/674465#M674632</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-07-30T13:07:32Z</dc:date>
    </item>
  </channel>
</rss>

