<?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 Using a calculated dimension in Aggr() in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-a-calculated-dimension-in-Aggr/m-p/629146#M476531</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello fellow qlikviewers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was wondering about wether it was possible to use a calculated dimension to aggregate by using the Aggr() function.&lt;/P&gt;&lt;P&gt;I have a dataset where data is logged every second, which I would like to, for example, aggregate per 15 minutes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can make a straight table chart using &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Floor(Sec,900)&lt;/P&gt;&lt;P&gt;as a dimension. This would however not enable me to take the average of each result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using the following (example):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Avg(Aggr(Count(Something),Floor(Sec,900)))&lt;/P&gt;&lt;P&gt;But it seems the Aggr() function won't accept this (getting no results).&lt;/P&gt;&lt;P&gt;I've also attached a quick example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I can do is create a new field during the load script the create the value which I wish to aggregate by (Floor(900) in above examples), but I would prefer not to have to do this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 May 2014 10:30:29 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-05-27T10:30:29Z</dc:date>
    <item>
      <title>Using a calculated dimension in Aggr()</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-calculated-dimension-in-Aggr/m-p/629146#M476531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello fellow qlikviewers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was wondering about wether it was possible to use a calculated dimension to aggregate by using the Aggr() function.&lt;/P&gt;&lt;P&gt;I have a dataset where data is logged every second, which I would like to, for example, aggregate per 15 minutes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can make a straight table chart using &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Floor(Sec,900)&lt;/P&gt;&lt;P&gt;as a dimension. This would however not enable me to take the average of each result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using the following (example):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Avg(Aggr(Count(Something),Floor(Sec,900)))&lt;/P&gt;&lt;P&gt;But it seems the Aggr() function won't accept this (getting no results).&lt;/P&gt;&lt;P&gt;I've also attached a quick example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I can do is create a new field during the load script the create the value which I wish to aggregate by (Floor(900) in above examples), but I would prefer not to have to do this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 10:30:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-calculated-dimension-in-Aggr/m-p/629146#M476531</guid>
      <dc:creator />
      <dc:date>2014-05-27T10:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using a calculated dimension in Aggr()</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-calculated-dimension-in-Aggr/m-p/629147#M476532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, aggr() would not respond to calculated dimension. Unfortunately, you have to create it in the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 10:35:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-calculated-dimension-in-Aggr/m-p/629147#M476532</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-05-27T10:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using a calculated dimension in Aggr()</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-calculated-dimension-in-Aggr/m-p/629148#M476533</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;As Treseco told, you cant have coalc dim in aggr. But in the case from your example expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(d2)/count(DISTINCT Aggr(Floor(d1,2),d1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should give expected result. You may need maybe one more if to check cases that there is no d2 for some d1. &lt;/P&gt;&lt;P&gt;Maybe in you real case you may use similiar....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 13:15:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-calculated-dimension-in-Aggr/m-p/629148#M476533</guid>
      <dc:creator />
      <dc:date>2014-05-27T13:15:33Z</dc:date>
    </item>
  </channel>
</rss>

