<?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: group round up in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/group-round-up/m-p/362543#M1174587</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Timestamps have a numerical representation, the integer part is representing days, the decimal places are representing hours, minutes, seconds (as fraction of the day).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you can do a numerical rounding, like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Timestamp(round(TimeStamp,1/(24*4))) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to create a new timestamp with value rounded to closest quarter of an hour (there are 24*4 quarters per day, so 1/(24*4) is the numerical step we could use here).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But please note that this might not match a timestamp that is created by QV time functions (e.g. using maketime() function). Please refer to &lt;A href="http://qlikviewnotes.blogspot.de/2011/10/correct-time-arithmetic.html"&gt;http://qlikviewnotes.blogspot.de/2011/10/correct-time-arithmetic.html&lt;/A&gt; for a more detailed explanation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get around this, you could use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Timestamp(daystart(TimeStamp)+Timestamp#(round(3600*hour(TimeStamp)+60*Minute(TimeStamp)+second(TimeStamp),60*15),'ss'))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you can use both methods, but you need to only use one method in your app consistently, so if you try matching timestamps creating with the two different approaches, you might run into trouble.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see also attached small sample (which will show also some differences between the two methods).&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>Sun, 22 Apr 2012 13:19:46 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-04-22T13:19:46Z</dc:date>
    <item>
      <title>group round up</title>
      <link>https://community.qlik.com/t5/QlikView/group-round-up/m-p/362542#M1174586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; &lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;Hello all&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;Need help anyone has any ideas ???&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;my database looks like this &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;Date time / sale value &lt;SPAN style="mso-tab-count: 1;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;19/4/2012 14:00 - 300&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;19/4/2012 14:00 - 300&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;19/4/2012 14:00 - 300&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;19/4/2012 14:15 - 500&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;19/4/2012 14:15 - 500&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;19/4/2012 14:15 - 500&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;I need to sum up each quarter hour and then subtract meaning (1500-900 = 600) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;My problem is that sometimes the DB sends hours like: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;19/4/2012 14:01 - 300&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;19/4/2012 14:16 – 500&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;And then the sum group doesn’t consider these hours &lt;SPAN style="mso-spacerun: yes;"&gt; &lt;/SPAN&gt;with 14:00 , 14:15 how can I round up the group &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Calibri;"&gt;Thanks alot&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Apr 2012 08:33:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/group-round-up/m-p/362542#M1174586</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-22T08:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: group round up</title>
      <link>https://community.qlik.com/t5/QlikView/group-round-up/m-p/362543#M1174587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Timestamps have a numerical representation, the integer part is representing days, the decimal places are representing hours, minutes, seconds (as fraction of the day).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you can do a numerical rounding, like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Timestamp(round(TimeStamp,1/(24*4))) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to create a new timestamp with value rounded to closest quarter of an hour (there are 24*4 quarters per day, so 1/(24*4) is the numerical step we could use here).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But please note that this might not match a timestamp that is created by QV time functions (e.g. using maketime() function). Please refer to &lt;A href="http://qlikviewnotes.blogspot.de/2011/10/correct-time-arithmetic.html"&gt;http://qlikviewnotes.blogspot.de/2011/10/correct-time-arithmetic.html&lt;/A&gt; for a more detailed explanation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get around this, you could use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Timestamp(daystart(TimeStamp)+Timestamp#(round(3600*hour(TimeStamp)+60*Minute(TimeStamp)+second(TimeStamp),60*15),'ss'))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you can use both methods, but you need to only use one method in your app consistently, so if you try matching timestamps creating with the two different approaches, you might run into trouble.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see also attached small sample (which will show also some differences between the two methods).&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>Sun, 22 Apr 2012 13:19:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/group-round-up/m-p/362543#M1174587</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-04-22T13:19:46Z</dc:date>
    </item>
  </channel>
</rss>

