<?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: Weighted average in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Weighted-average/m-p/1023230#M346005</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(Aggr(Only({&amp;lt;Type = {'Count of sale'}&amp;gt;} [Shoe Sales]) * Only({&amp;lt;Type = {'Average (days)'}&amp;gt;}[Shoe Sales]), [File Month], [Supplier Name], Department))/Sum(&lt;SPAN style="font-size: 13.3333px;"&gt;{&amp;lt;Type = {'Count of sale'}&amp;gt;} [Shoe Sales]&lt;/SPAN&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Feb 2016 18:04:23 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-02-12T18:04:23Z</dc:date>
    <item>
      <title>Weighted average</title>
      <link>https://community.qlik.com/t5/QlikView/Weighted-average/m-p/1023229#M346004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, need some help please in calculating the weighted average, for this contrived example I have 2 figures which are in a Pivot table, in&amp;nbsp; the following format (one fact table), lets say one figure represents the count of sales and the another figure represents the average time of those sales per department.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I calculate the weighted average time of sales of each different product for a company (i.e. not by department)???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/114472_Capture.PNG" style="width: 620px; height: 156px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried something like this but I think I need to use the AGGR function but not quite sure how.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(({$&amp;lt;Type={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"Count of sale"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Shoe Sales]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) * ({$&amp;lt;Type={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"Average (days)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Shoe Sales]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))/SUM({$&amp;lt;Type={&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"Count of sale"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Shoe Sales]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Many thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 14:25:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weighted-average/m-p/1023229#M346004</guid>
      <dc:creator />
      <dc:date>2016-02-12T14:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted average</title>
      <link>https://community.qlik.com/t5/QlikView/Weighted-average/m-p/1023230#M346005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(Aggr(Only({&amp;lt;Type = {'Count of sale'}&amp;gt;} [Shoe Sales]) * Only({&amp;lt;Type = {'Average (days)'}&amp;gt;}[Shoe Sales]), [File Month], [Supplier Name], Department))/Sum(&lt;SPAN style="font-size: 13.3333px;"&gt;{&amp;lt;Type = {'Count of sale'}&amp;gt;} [Shoe Sales]&lt;/SPAN&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 18:04:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weighted-average/m-p/1023230#M346005</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-12T18:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted average</title>
      <link>https://community.qlik.com/t5/QlikView/Weighted-average/m-p/1023231#M346006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks for this, works perfectly, I was actually trying it with Only instead of Sum but was missing the AGGR bit, thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 19:37:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weighted-average/m-p/1023231#M346006</guid>
      <dc:creator />
      <dc:date>2016-02-12T19:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted average</title>
      <link>https://community.qlik.com/t5/QlikView/Weighted-average/m-p/1023232#M346007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 19:42:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weighted-average/m-p/1023232#M346007</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-12T19:42:21Z</dc:date>
    </item>
  </channel>
</rss>

