<?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 Rounding time in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374970#M702659</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need some help on rounding. I have some values that I want to round either to the closest hour or closest half hour.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example: (This is a 24 hour clock, not 12)&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;00.28.26 should be 00.30.00&lt;/P&gt;&lt;P&gt;07.58.26 should be 08.00.00&lt;/P&gt;&lt;P&gt;19.58.26 should be 20.00.00&lt;/P&gt;&lt;P&gt;20.29.00 should be 20.30.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea how to go about this?&lt;/P&gt;&lt;P&gt;My field with the time data is called "Metrics Time"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jul 2012 15:53:15 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-07-30T15:53:15Z</dc:date>
    <item>
      <title>Rounding time</title>
      <link>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374970#M702659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need some help on rounding. I have some values that I want to round either to the closest hour or closest half hour.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example: (This is a 24 hour clock, not 12)&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;00.28.26 should be 00.30.00&lt;/P&gt;&lt;P&gt;07.58.26 should be 08.00.00&lt;/P&gt;&lt;P&gt;19.58.26 should be 20.00.00&lt;/P&gt;&lt;P&gt;20.29.00 should be 20.30.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea how to go about this?&lt;/P&gt;&lt;P&gt;My field with the time data is called "Metrics Time"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2012 15:53:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374970#M702659</guid>
      <dc:creator />
      <dc:date>2012-07-30T15:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding time</title>
      <link>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374971#M702660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assumed you have set your time format accordingly and your field is interpreted as time value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;[Metrics Time],&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;time(round([Metrics Time],maketime(0,30))) &lt;/STRONG&gt;as RoundedMetricsTime,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM ...;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2012 16:01:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374971#M702660</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-07-30T16:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding time</title>
      <link>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374972#M702661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Swuehl to the rescue! As always!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That function loads but the new field doesn't have any data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps I haven't done the correct formatting?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2012 17:25:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374972#M702661</guid>
      <dc:creator />
      <dc:date>2012-07-30T17:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding time</title>
      <link>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374973#M702662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you haven't set the correct standard time format, your field is probably not correctly interpreted, try &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt; &lt;EM&gt;&lt;STRONG&gt;time(round([Metrics Time],maketime(0,30))) &lt;/STRONG&gt;as RoundedMetricsTime;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;time#([Metrics Time],'hh.mm.ss') &lt;/STRONG&gt;as [Metrics Time]&lt;/P&gt;&lt;P&gt;&lt;EM&gt;...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM ...;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are coping with intervals rather than time values (i.e. values can exceed 24h), use the interval#() / interval() functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2012 17:31:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374973#M702662</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-07-30T17:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding time</title>
      <link>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374974#M702663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess im kind of confused as to where im putting all this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'd think I would have gotten it by now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2012 17:44:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374974#M702663</guid>
      <dc:creator />
      <dc:date>2012-07-30T17:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding time</title>
      <link>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374975#M702664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If above is your general format you want to use as time format, use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SET TimeFormat='hh.mm.ss';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at the top of your script. If so, I would recommend to use the standard format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you interpret a time format using time#() function, this will only affect the field you are applying this function to ([Metrics Time2] in your example). So if you use TIME again in the calculation for the rounded value, the format is not interpreted with the 'special' format code. You can do a preceding load like I've shown above or just embed the format interpretation into the round:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;time(round( time#([Time],'hh.mm.ss'),maketime(0,30))) &lt;/STRONG&gt;as RoundedMetricsTime;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2012 17:51:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374975#M702664</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-07-30T17:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding time</title>
      <link>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374976#M702665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Im pretty sure you know everything about this program!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2012 18:04:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374976#M702665</guid>
      <dc:creator />
      <dc:date>2012-07-30T18:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding time</title>
      <link>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374977#M702666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to round the time is also very important to show the correct interval value in the format hh:mm:ss. I've had the problem, that QV shows the floor-value of an interval.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;0,00024722223 = 00:05:00&lt;/P&gt;&lt;P&gt;0,00024722221 should be rounded to 00:05:00, but QV shows 00:04:59&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By using the expression round(value,maketime(0,0,1)), QV rounds the value to the nearest full second. In my example it is 00:05:00.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bye,&lt;/P&gt;&lt;P&gt;Riffi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 11:32:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rounding-time/m-p/374977#M702666</guid>
      <dc:creator />
      <dc:date>2014-02-07T11:32:22Z</dc:date>
    </item>
  </channel>
</rss>

