<?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 Expression using avg of current selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-using-avg-of-current-selection/m-p/1206123#M877935</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a real-estate dataframe with several features( square_feet, Number_of_rooms,Number_of_garages,Sale_Price...) and I would like to compare the Saleprice to the average saleprice of similar houses.&lt;/P&gt;&lt;P&gt;That is, select a range of square_feet, &lt;SPAN style="font-size: 13.3333px;"&gt;Number_of_rooms, Number_of_garages and evaluate : &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;x = 100*(Sale_Price-Avg(Sale_Price[selection])/(Avg(Sale_Price[selection])))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to display this value in a table with the other features displayed as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For now I managed to evaluate my expression with the global average, independant of the selection, and can't figure out what to change.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Expression using avg of current selection</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-using-avg-of-current-selection/m-p/1206123#M877935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a real-estate dataframe with several features( square_feet, Number_of_rooms,Number_of_garages,Sale_Price...) and I would like to compare the Saleprice to the average saleprice of similar houses.&lt;/P&gt;&lt;P&gt;That is, select a range of square_feet, &lt;SPAN style="font-size: 13.3333px;"&gt;Number_of_rooms, Number_of_garages and evaluate : &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;x = 100*(Sale_Price-Avg(Sale_Price[selection])/(Avg(Sale_Price[selection])))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to display this value in a table with the other features displayed as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For now I managed to evaluate my expression with the global average, independant of the selection, and can't figure out what to change.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-using-avg-of-current-selection/m-p/1206123#M877935</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Expression using avg of current selection</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-using-avg-of-current-selection/m-p/1206124#M877936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this may be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;STRONG&gt; 100 * (Avg({1}Sale_Price)-Avg({$} Sale_Price))/&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;STRONG&gt;Avg({$} Sale_Price)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where &lt;STRONG&gt;Avg({1}&lt;/STRONG&gt;&lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;Sale_Price) &lt;/STRONG&gt;won't change based on selection, but &lt;STRONG&gt;Avg({$} Sale_Price)&lt;/STRONG&gt; will.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: You can use &lt;STRONG&gt;Avg(Sale_Price)&lt;/STRONG&gt; in place of &lt;STRONG&gt;Avg({$} Sale_price)&lt;/STRONG&gt; because when nothing is specified, the default is $&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 19:31:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-using-avg-of-current-selection/m-p/1206124#M877936</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-19T19:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Expression using avg of current selection</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-using-avg-of-current-selection/m-p/1206125#M877937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The context you are trying to create your expression for is important.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to use the expression in a chart with Houses as dimension (and potentially your other features like square feet), you would probably need to use the TOTAL qualifier (or a TOTAL qualifier with field list)&amp;nbsp; to disregard the dimensions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt; = 100*(Only( Sale_Price)-Avg(&lt;STRONG&gt;TOTAL&lt;/STRONG&gt; Sale_Price) )/(Avg(&lt;STRONG&gt;TOTAL&lt;/STRONG&gt; Sale_Price)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this doesn't help, then it might be helpful if you can post a small sample QVW or some sample records and your expected result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3285"&gt;The Aggregation Scope&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 19:54:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-using-avg-of-current-selection/m-p/1206125#M877937</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-10-19T19:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Expression using avg of current selection</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-using-avg-of-current-selection/m-p/1206126#M877938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you, the TOTAL do the trick. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2016 06:21:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-using-avg-of-current-selection/m-p/1206126#M877938</guid>
      <dc:creator />
      <dc:date>2016-10-20T06:21:18Z</dc:date>
    </item>
  </channel>
</rss>

