<?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 Weighted average in a straight table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Weighted-average-in-a-straight-table/m-p/315986#M583266</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(dimensionality()=0,sum(aggr(FIELD1*FIELD2,DIMENSION))/sum(FIELD1), YOURROWEXPRESSION))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where sum(aggr(FIELD1*FIELD2,DIMENSION))/sum(FIELD1) is calculating the weighted average of FIELD2 weighted by FIELD1, and DIMENSION is your chart dimension (if you have more than one, &lt;BR /&gt;you need to specify all comma separated).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YOURROWEXPRESSION is the expression you want to show for the table rows.&lt;/P&gt;&lt;P&gt;If you don't want it different, you just can state&lt;/P&gt;&lt;P&gt;=sum(aggr(FIELD1*FIELD2,DIMENSION)) / sum(FIELD1)&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, 13 Nov 2011 22:37:46 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2011-11-13T22:37:46Z</dc:date>
    <item>
      <title>Weighted average in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Weighted-average-in-a-straight-table/m-p/315985#M583264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I want to create a weighted average in the totals row on a straight table. Basically we want to create a sum product of two columns and divide by sum of one column. Is it possible in qlikview?Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Nov 2011 22:06:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weighted-average-in-a-straight-table/m-p/315985#M583264</guid>
      <dc:creator />
      <dc:date>2011-11-13T22:06:45Z</dc:date>
    </item>
    <item>
      <title>Weighted average in a straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Weighted-average-in-a-straight-table/m-p/315986#M583266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(dimensionality()=0,sum(aggr(FIELD1*FIELD2,DIMENSION))/sum(FIELD1), YOURROWEXPRESSION))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where sum(aggr(FIELD1*FIELD2,DIMENSION))/sum(FIELD1) is calculating the weighted average of FIELD2 weighted by FIELD1, and DIMENSION is your chart dimension (if you have more than one, &lt;BR /&gt;you need to specify all comma separated).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YOURROWEXPRESSION is the expression you want to show for the table rows.&lt;/P&gt;&lt;P&gt;If you don't want it different, you just can state&lt;/P&gt;&lt;P&gt;=sum(aggr(FIELD1*FIELD2,DIMENSION)) / sum(FIELD1)&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, 13 Nov 2011 22:37:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weighted-average-in-a-straight-table/m-p/315986#M583266</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-11-13T22:37:46Z</dc:date>
    </item>
  </channel>
</rss>

