<?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 Aggr function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/283095#M105212</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So your timestamp_start is already giving you the appropriate class, or do you look for a way to classify your timestamps into 30 min slots?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If latter, try to add something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD ..&lt;/P&gt;&lt;P&gt;timestamp(floor(YOURTIMESTAMPFIELD, 1/48&amp;nbsp; )) as StartTimeStampSlot,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;FROM ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use this as field in your above aggr(), it should correctly count your Timestamps in each 30 min slot.&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, 30 Oct 2011 14:03:01 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2011-10-30T14:03:01Z</dc:date>
    <item>
      <title>Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/283094#M105211</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 trying to get Aggr() to do my work, but I am having a problem.&lt;/P&gt;&lt;P&gt;I am loading a file into qlikview that holds a lot of timestamps (about 150.000). And&lt;/P&gt;&lt;P&gt;I want to count the number of timestamps in 30 min incraments, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Starttime&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Number&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Percent of total&lt;/P&gt;&lt;P&gt;0600-0630&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 312&lt;/P&gt;&lt;P&gt;0630-0700&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 894&lt;/P&gt;&lt;P&gt;0700-0730&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1092&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Aggr(count(timestamp_start), timestamp_start) i am close to what I want with the counting.&lt;/P&gt;&lt;P&gt;Does anybody know how I can accomplish this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Oct 2011 13:26:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/283094#M105211</guid>
      <dc:creator>qw_johan</dc:creator>
      <dc:date>2011-10-30T13:26:51Z</dc:date>
    </item>
    <item>
      <title>Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/283095#M105212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So your timestamp_start is already giving you the appropriate class, or do you look for a way to classify your timestamps into 30 min slots?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If latter, try to add something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD ..&lt;/P&gt;&lt;P&gt;timestamp(floor(YOURTIMESTAMPFIELD, 1/48&amp;nbsp; )) as StartTimeStampSlot,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;FROM ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use this as field in your above aggr(), it should correctly count your Timestamps in each 30 min slot.&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, 30 Oct 2011 14:03:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/283095#M105212</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-10-30T14:03:01Z</dc:date>
    </item>
    <item>
      <title>Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/283096#M105213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok...I did it like this...se below.&lt;/P&gt;&lt;P&gt;But isn't there a better way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(starttime&amp;lt;'0600', 'before 0600', &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(starttime&amp;gt;='0600' and starttime&amp;lt;'0630', '0600-0629', &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(starttime&amp;gt;='0630' and starttime&amp;lt;'0700', '0630-0659',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(starttime&amp;gt;='0700' and starttime&amp;lt;'0730', '0700-0729',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(starttime&amp;gt;='0730' and starttime&amp;lt;'0800', '0730-0759',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(starttime&amp;gt;='0800' and starttime&amp;lt;'0830', '0800-0829',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(starttime&amp;gt;='0830' and starttime&amp;lt;'0900', '0830-0859',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(starttime&amp;gt;='0900' and starttime&amp;lt;'0930', '0900-0929',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(starttime&amp;gt;='0930' and starttime&amp;lt;'1000', '0930-0959',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(starttime&amp;gt;='1000' and starttime&amp;lt;'1030', '1000-1029',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(starttime&amp;gt;='1030' and starttime&amp;lt;'1100', '1030-1159', 'later than 1100'))))))))))) as my_starttid,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Oct 2011 14:04:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/283096#M105213</guid>
      <dc:creator>qw_johan</dc:creator>
      <dc:date>2011-10-30T14:04:28Z</dc:date>
    </item>
    <item>
      <title>Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/283097#M105214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply Stefan. &lt;/P&gt;&lt;P&gt;I tried to include your code ... timestamp(floor(YOURTIMESTAMPFIELD, 1/48&amp;nbsp; )) as StartTimeStampSlot&lt;/P&gt;&lt;P&gt;in my load script...but was unsuccessful. No error, just didn't really do anything. I did reload a few times.&lt;/P&gt;&lt;P&gt;What does 1/48 do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Oct 2011 14:13:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/283097#M105214</guid>
      <dc:creator>qw_johan</dc:creator>
      <dc:date>2011-10-30T14:13:43Z</dc:date>
    </item>
    <item>
      <title>Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/283098#M105215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your starttime is not a real Timestamp, it's a string, right? I assumed a timestamp with numerical representation with my above expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1/48 is the numerical representation of 30 min (1/48 of a day)).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, do you have a real timestamp available or just a string representation?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Oct 2011 14:23:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/283098#M105215</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-10-30T14:23:36Z</dc:date>
    </item>
    <item>
      <title>Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/283099#M105216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your're right! My timestamp isn't a real timestamp, it's a string. I have the date in another string too, so I could create a timestamp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"1/48 is the numerical representation of 30 min (1/48 of a day))"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Oh, ok I understand.&lt;/P&gt;&lt;P&gt;I think I am going to try your approch again...by creating a timestamp and work with that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, I don't have a true timestamp available ... I just have the string.... But I could create one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Oct 2011 14:51:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/283099#M105216</guid>
      <dc:creator>qw_johan</dc:creator>
      <dc:date>2011-10-30T14:51:35Z</dc:date>
    </item>
    <item>
      <title>Aggr function</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/283100#M105217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you could probably live with both, real timestamps have the advantage that you could easily calculate (e.g. differences) with their numerical representation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if you want to get strings for the classes like above (e.g. '1600-1629') you could use something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=timestamp(floor(now(), 1/48&amp;nbsp; ),'hhmm')&amp;amp;'-'&amp;amp;timestamp(ceil(now(),1/48)-1/(24*60),'hhmm')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just replace now() with your Timestamp field then.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;having a classification like that, you could then cut to lower and upper limits like in your above snippet (before 0600 and later than 1100 using a somewhat shorter if(statement).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also look into class function to get something similar, but I think you have more freedom in formatting doing it like suggested above.&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, 30 Oct 2011 15:23:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function/m-p/283100#M105217</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-10-30T15:23:05Z</dc:date>
    </item>
  </channel>
</rss>

