<?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: Issue with table having Aggr Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Issue-with-table-having-Aggr-Expression/m-p/906372#M1013015</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use calculated dimensions for Timestamp and Score as well:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Timestamp: &lt;STRONG&gt;=Aggr(FirstSortedValue(Timestamp, -Timestamp), Question, Subject)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;For Score:&lt;STRONG&gt; =Aggr(FirstSortedValue(Score, -Timestamp), Question, Subject)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also find attached your application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 26 Apr 2015 22:49:00 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2015-04-26T22:49:00Z</dc:date>
    <item>
      <title>Issue with table having Aggr Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Issue-with-table-having-Aggr-Expression/m-p/906370#M1013013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, In the attached qlikview file, there are two tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 1 calculates the average score taking the RECENT response. This calculation works as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In table 2, I want to show the recent response that was considered. I also need to show the final average. This is not working as expected. If we filter subject C, Question 1 , we can see table 1 displays first value instead of recent value. Any help on fixing this would be appreciated. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture123.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/85067_Capture123.PNG" style="height: 225px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Apr 2015 22:01:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issue-with-table-having-Aggr-Expression/m-p/906370#M1013013</guid>
      <dc:creator />
      <dc:date>2015-04-26T22:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with table having Aggr Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Issue-with-table-having-Aggr-Expression/m-p/906371#M1013014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With your selection Table2 has two data points. Disable Zero-Value suppression, and you will see that Table2 has the same dimensions as your table box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Chart Object &amp;gt; Properties &amp;gt; Presentation&lt;/P&gt;&lt;P&gt;2. Uncheck Suppress Zero-Values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also keep in mind that Aggr() returns distinct data by default. Add NODISTINCT in your expression to get the result to expand on all rows of the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avg(Aggr(NODISTINCT FirstSortedValue(Score, -Timestamp), Question, Subject)) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Apr 2015 22:23:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issue-with-table-having-Aggr-Expression/m-p/906371#M1013014</guid>
      <dc:creator>ToniKautto</dc:creator>
      <dc:date>2015-04-26T22:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with table having Aggr Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Issue-with-table-having-Aggr-Expression/m-p/906372#M1013015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use calculated dimensions for Timestamp and Score as well:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Timestamp: &lt;STRONG&gt;=Aggr(FirstSortedValue(Timestamp, -Timestamp), Question, Subject)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;For Score:&lt;STRONG&gt; =Aggr(FirstSortedValue(Score, -Timestamp), Question, Subject)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also find attached your application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Apr 2015 22:49:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issue-with-table-having-Aggr-Expression/m-p/906372#M1013015</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-04-26T22:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with table having Aggr Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Issue-with-table-having-Aggr-Expression/m-p/906373#M1013016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Generally calculated dimensions should be avoided, as they add a virtual dimension to the calculation. This is very likely to have a negative impact on the chart performance and also can lead to unexpected calculation results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Aggr() based example looks a bit over complicated.&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Working with flags in your data model for example allows for making simple set expressions in your charts. By using a set expression you limit the dimensional values, compared to creating virtual dimensions through Aggr().&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As an example in the attached QVW I have created a flag during load where the most recent records are flagged with 1. With this flag you no longer have to used Aggr() in your chart, instead a simple set expression will limit your aggregation to the data with the flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;Only({&amp;lt;IsMostRecentScore={"1"}&amp;gt;} Score)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;In my opinion this is easier to interpret and understand fro a user or developer, as the expression says that the result is based on data related to the most recent score. It also means that the aggregation is done on a data set based on the set modifier, which commonly means that less data is processed. Simplicity and efficiency.&amp;nbsp; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;See Table3 in the attachment as reference.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Apr 2015 23:52:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issue-with-table-having-Aggr-Expression/m-p/906373#M1013016</guid>
      <dc:creator>ToniKautto</dc:creator>
      <dc:date>2015-04-26T23:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with table having Aggr Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Issue-with-table-having-Aggr-Expression/m-p/906374#M1013017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I def. agree with you and I would want to avoid using aggregate function in any of my charts, but in his case I am not sure if there is a reason he would want to do this on a front end. If this not a requirement then I would definitely do it the way you have recommended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2015 00:36:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issue-with-table-having-Aggr-Expression/m-p/906374#M1013017</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-04-27T00:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with table having Aggr Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Issue-with-table-having-Aggr-Expression/m-p/906375#M1013018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with the both of you. There is a requirement to do this on the front end and not to disturb the data model. Hence the use of Aggr function. Thank you for your input once again. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2015 14:46:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issue-with-table-having-Aggr-Expression/m-p/906375#M1013018</guid>
      <dc:creator />
      <dc:date>2015-04-27T14:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with table having Aggr Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Issue-with-table-having-Aggr-Expression/m-p/906376#M1013019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The design choice is of course yours to make. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please notice that if you apply the Aggr() approach in multiple chart in your application you will consume more memory and CPU compared to having a optimized data model. Using Aggr() in a straight table dimension is definitely not a recommended approach, and I think you should be able to move them to expressions instead. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adding flags to data models does not make any logical change to the data model structure, and will not affect any existing calculation. I think you should make sure to keep that approach open for any future projects, as it will make your work easier and the results better. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 03:57:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issue-with-table-having-Aggr-Expression/m-p/906376#M1013019</guid>
      <dc:creator>ToniKautto</dc:creator>
      <dc:date>2015-04-28T03:57:09Z</dc:date>
    </item>
  </channel>
</rss>

