<?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 aggr() and if() function to return data on the correct row query in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333834#M123091</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;Am trying to build some KPI reports, returning the results of a survey against some pre-defined metrics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the moment, when I incorrectly use a straight "avg(Value)" formula, I am able to get my data to appear in the correct layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Replicating the above, but using a correct "aggr()" function, I am no longer able to get my desired layout (but am able to get the correct figures).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see the attached QV doc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any thoughts as to how I can overcome this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Mar 2012 13:24:59 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-03-02T13:24:59Z</dc:date>
    <item>
      <title>Using aggr() and if() function to return data on the correct row query</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333834#M123091</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;Am trying to build some KPI reports, returning the results of a survey against some pre-defined metrics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the moment, when I incorrectly use a straight "avg(Value)" formula, I am able to get my data to appear in the correct layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Replicating the above, but using a correct "aggr()" function, I am no longer able to get my desired layout (but am able to get the correct figures).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see the attached QV doc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any thoughts as to how I can overcome this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 13:24:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333834#M123091</guid>
      <dc:creator />
      <dc:date>2012-03-02T13:24:59Z</dc:date>
    </item>
    <item>
      <title>Using aggr() and if() function to return data on the correct row query</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333835#M123092</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;Use this expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=aggr((avg(Value)),[Metric KPI],Tab, Site)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 13:29:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333835#M123092</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2012-03-02T13:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using aggr() and if() function to return data on the correct row query</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333836#M123093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe like in attached sample?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just added a NODISTINCT to some aggr() function, added an additional if() clause to limit the results and&amp;nbsp; added a TOTAL qualifier to avg() in a another spot.You'll see when looking at the expressions.&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>Fri, 02 Mar 2012 13:39:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333836#M123093</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-03-02T13:39:10Z</dc:date>
    </item>
    <item>
      <title>Using aggr() and if() function to return data on the correct row query</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333837#M123094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your response!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at your proposal, its not quite giving me the number that I am looking for.&amp;nbsp; I was hoping to see the result of the aggr() function to return 3.2 (and not the current 2.6 - which is returning the same result as my straight "avg(Value) formula..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any additional thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rich &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 14:10:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333837#M123094</guid>
      <dc:creator />
      <dc:date>2012-03-02T14:10:32Z</dc:date>
    </item>
    <item>
      <title>Using aggr() and if() function to return data on the correct row query</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333838#M123095</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;Try this expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(Score=3,&lt;/P&gt;&lt;P&gt;avg(aggr((&lt;/P&gt;&lt;P&gt;avg(Value)&lt;/P&gt;&lt;P&gt;),[Metric KPI],Tab, Score))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;,0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 14:20:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333838#M123095</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2012-03-02T14:20:02Z</dc:date>
    </item>
    <item>
      <title>Using aggr() and if() function to return data on the correct row query</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333839#M123096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; apologies Stefan, your initial proposal was spot on - I was looking in a different table for your results!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once again, many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 14:28:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333839#M123096</guid>
      <dc:creator />
      <dc:date>2012-03-02T14:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using aggr() and if() function to return data on the correct row query</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333840#M123097</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;Just incorporated the above proposal into my main system, and wasn't getting the desired results, despite everything looking spot on in the sample file that I created (please see the tab in red in the attached document)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adding in additional Metric KPI's, I am now getting the same result appear across 2 different KPI's whilst in reality, I would expect to see 2 different values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie in the attached document, both "Commitment" and "Communication" are returning the same value "3", when in reality I would expect to see "3.2" and "2.8" being returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am assuming this is due to the inclusion of the "Total" statement, but unsure how best to fine tune?&amp;nbsp; Anyone with any thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 15:03:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333840#M123097</guid>
      <dc:creator />
      <dc:date>2012-03-02T15:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using aggr() and if() function to return data on the correct row query</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333841#M123098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a little bit in a hurry, but attached seems to look better, using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(Score=3,&lt;/P&gt;&lt;P&gt;avg(total&amp;lt;[Metric KPI],Score&amp;gt; aggr(&lt;/P&gt;&lt;P&gt;avg(total&amp;lt;[Metric KPI],Tab&amp;gt; Value)&lt;/P&gt;&lt;P&gt;,[Metric KPI],Tab,Score))&lt;/P&gt;&lt;P&gt;,0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls have a look,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 17:04:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333841#M123098</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-03-02T17:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using aggr() and if() function to return data on the correct row query</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333842#M123099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Many thanks Stefan for taking time to look at the above!&amp;nbsp; All looking fantastic!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wish you a very nice weekend,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 18:15:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-and-if-function-to-return-data-on-the-correct-row/m-p/333842#M123099</guid>
      <dc:creator />
      <dc:date>2012-03-02T18:15:42Z</dc:date>
    </item>
  </channel>
</rss>

