<?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: AVG, SUM, Set Analysis, Pivot Table Headache in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444330#M165675</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi you can do it 2 ways:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If( count(distinct ....) = 1, &amp;lt;formula for unique item&amp;gt;, &amp;lt;formula for more than 1 item&amp;gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using aggr() that helps to do calculation on many levels, but a bit complex to demonstrate without an example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Sep 2012 13:15:08 GMT</pubDate>
    <dc:creator>nstefaniuk</dc:creator>
    <dc:date>2012-09-26T13:15:08Z</dc:date>
    <item>
      <title>AVG, SUM, Set Analysis, Pivot Table Headache</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444329#M165674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really need some help because i don't know anymore....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have to build&lt;/P&gt;&lt;P&gt;1. Pivot table&lt;/P&gt;&lt;P&gt;2. AVG of prices per line item&lt;/P&gt;&lt;P&gt;3. SUM for a grouped collection&lt;/P&gt;&lt;P&gt;4. Must be for a speciffic month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i am trying this:&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/P&gt;&lt;P&gt;Avg({1&amp;lt;ML_DateFilter={$(vCurrDateTest)}&amp;gt;}(ML_BE_CostAmount/1))&lt;/P&gt;&lt;P&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/P&gt;&lt;P&gt;SUM({1&amp;lt;ML_DateFilter={$(vCurrDateTest)}&amp;gt;}(ML_BE_CostAmount/1))&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;COUNT({1&amp;lt;ML_DateFilter={$(vCurrDateTest)}&amp;gt;}(ML_BE_CostAmount))&lt;/P&gt;&lt;P&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in both cases we get the AVG as total when they are combined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason is we have a few entries for the month, and SUM will multiply them (which we don't want) because a price of 100x4 now becomes 400 when we DO want the avg in that time of 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know with a straight table you can easily select the Total Mode, but it is greyed out for Pivit Table, and always uses Expression Total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 12:58:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444329#M165674</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2012-09-26T12:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: AVG, SUM, Set Analysis, Pivot Table Headache</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444330#M165675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi you can do it 2 ways:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If( count(distinct ....) = 1, &amp;lt;formula for unique item&amp;gt;, &amp;lt;formula for more than 1 item&amp;gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using aggr() that helps to do calculation on many levels, but a bit complex to demonstrate without an example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 13:15:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444330#M165675</guid>
      <dc:creator>nstefaniuk</dc:creator>
      <dc:date>2012-09-26T13:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: AVG, SUM, Set Analysis, Pivot Table Headache</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444331#M165676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i use count(distinct()) within Set Analysis?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because not using Set analysis counts it across all months&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 13:29:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444331#M165676</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2012-09-26T13:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: AVG, SUM, Set Analysis, Pivot Table Headache</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444332#M165677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If(count({$&amp;lt;...&amp;gt;}distinct item_id) =1, .., ...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 13:33:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444332#M165677</guid>
      <dc:creator>nstefaniuk</dc:creator>
      <dc:date>2012-09-26T13:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: AVG, SUM, Set Analysis, Pivot Table Headache</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444333#M165678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi HS, an you post some of your sample data which will be easy for everyone to solve your problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 13:41:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444333#M165678</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-09-26T13:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: AVG, SUM, Set Analysis, Pivot Table Headache</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444334#M165679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I must build a little sample, as i cannot sent the customer data.&lt;/P&gt;&lt;P&gt;I can do this tomorrow sometime.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 13:58:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444334#M165679</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2012-09-26T13:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: AVG, SUM, Set Analysis, Pivot Table Headache</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444335#M165680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yeah please do that you will get the perfect solution which you are looking for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 14:18:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444335#M165680</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-09-26T14:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: AVG, SUM, Set Analysis, Pivot Table Headache</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444336#M165681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry it took so long to respond, but i have been crazy busy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This now doesn't have the set analysis for the date, but it gives an example of what the query/issue is about.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 09:50:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444336#M165681</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2012-10-15T09:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: AVG, SUM, Set Analysis, Pivot Table Headache</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444337#M165682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a loo at the example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this what you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 09:56:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444337#M165682</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2012-10-15T09:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: AVG, SUM, Set Analysis, Pivot Table Headache</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444338#M165683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes! That is on the right track &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand now. So i just pop my set analysis into the AVG calc like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(aggr(Avg({1&amp;lt;Date={'Oct'}&amp;gt;}(Value)),Area,Customer))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it works 100%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 10:32:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-SUM-Set-Analysis-Pivot-Table-Headache/m-p/444338#M165683</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2012-10-15T10:32:47Z</dc:date>
    </item>
  </channel>
</rss>

