<?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: Average functions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Average-functions/m-p/569585#M478553</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your replies, I've managed to get the right answer for the the Average SKUs for which I used this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=avg(Total Aggr(count(SKU), location_id)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather than have different values against each location I want to have the same value against each. I hope that makes some sort of sense?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Mar 2014 10:47:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-03-13T10:47:25Z</dc:date>
    <item>
      <title>Average functions</title>
      <link>https://community.qlik.com/t5/QlikView/Average-functions/m-p/569580#M478548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I've only just started working with QlikView this week as the company I work for is transitioning to it from Cognos and Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We currently have a customer segmentation model built in Excel which I would like to replicate in QlikView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where I'm struggling is calculating average gross sales for our customer base as a whole. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a straight table that looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Location_ID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Gross Sales&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Gross Margin&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;N. SKUs purchased&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Average SKUs purchased &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Average gross sales&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1.5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0.5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm struggling to fill the last two columns with the data I want for subsequent calculations. The last two columns should contain the same number all the way from the top to the bottom. Average SKUs in the example above would be 5.25 and Average gross sales would be 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What function should I be using and how should I be scripting it? Is it a variation on Aggr? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 10:21:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-functions/m-p/569580#M478548</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-13T10:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Average functions</title>
      <link>https://community.qlik.com/t5/QlikView/Average-functions/m-p/569581#M478549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter, If you just use Avg(Total [Gross Sales]), that should work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 10:23:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-functions/m-p/569581#M478549</guid>
      <dc:creator />
      <dc:date>2014-03-13T10:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Average functions</title>
      <link>https://community.qlik.com/t5/QlikView/Average-functions/m-p/569582#M478550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;sum(Total GrossSales)/count(GrossSales)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 10:26:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-functions/m-p/569582#M478550</guid>
      <dc:creator />
      <dc:date>2014-03-13T10:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Average functions</title>
      <link>https://community.qlik.com/t5/QlikView/Average-functions/m-p/569583#M478551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;For Average SKUs purchased, you can use : =AVG (TOTAL [N. SKUs purchased]) and for Average gross sales you can use : =AVG(TOTAL [Gross Sales])&lt;BR /&gt; Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 10:28:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-functions/m-p/569583#M478551</guid>
      <dc:creator />
      <dc:date>2014-03-13T10:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Average functions</title>
      <link>https://community.qlik.com/t5/QlikView/Average-functions/m-p/569584#M478552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I you want below output:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Average.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/54927_Average.png" style="width: 620px; height: 144px;" /&gt;&lt;/P&gt;&lt;P&gt;Then you need to add two expressions for calculating average.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1). Avg&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[N. SKUs purchased]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;2). &lt;/SPAN&gt;Avg&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Gross Sales]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 10:34:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-functions/m-p/569584#M478552</guid>
      <dc:creator>jsingh71</dc:creator>
      <dc:date>2014-03-13T10:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Average functions</title>
      <link>https://community.qlik.com/t5/QlikView/Average-functions/m-p/569585#M478553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your replies, I've managed to get the right answer for the the Average SKUs for which I used this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=avg(Total Aggr(count(SKU), location_id)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather than have different values against each location I want to have the same value against each. I hope that makes some sort of sense?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 10:47:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-functions/m-p/569585#M478553</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-13T10:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Average functions</title>
      <link>https://community.qlik.com/t5/QlikView/Average-functions/m-p/569586#M478554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;Thanks for your replies, I've managed to get the right answer for the the Average SKUs for which I used this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;=avg(Total Aggr(count(SKU), location_id)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;Rather than have different values against each location I want to have the same value against each. I hope that makes some sort of sense?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 10:52:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-functions/m-p/569586#M478554</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-13T10:52:55Z</dc:date>
    </item>
  </channel>
</rss>

