<?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: sum aggregate averages in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/sum-aggregate-averages/m-p/460029#M561499</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now that worked when I had a single year selected.&amp;nbsp; but doesn't work when there are multiple years. any thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Mar 2013 12:02:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-03-20T12:02:38Z</dc:date>
    <item>
      <title>sum aggregate averages</title>
      <link>https://community.qlik.com/t5/QlikView/sum-aggregate-averages/m-p/460026#M561496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table with columns for:&lt;/P&gt;&lt;P&gt;Mall&lt;/P&gt;&lt;P&gt;Tenant&lt;/P&gt;&lt;P&gt;Month&lt;/P&gt;&lt;P&gt;Sales&lt;/P&gt;&lt;P&gt;SquareFootage&lt;/P&gt;&lt;P&gt;To show sales by month for tenants at different malls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a bar chart to show total sales per Year.&lt;/P&gt;&lt;P&gt;I'm also trying to create a chart to show sales per square feet per year.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to average the square footages for each specific tenant over the year, and then take the sum of those square feet.&amp;nbsp; However, I only want to include tenants who have 12 full months of sales for that year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression I'm using is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM ( AGGR ( AVG ( IF ( COUNT ( DISTINCT Month ) = 12 , SquareFootage , 0 ) ) , Mall , Tenant )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it returns no data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am able to get to work is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM ( AGGR ( AVG ( SquareFootage ) , Mall , Tenant ))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which returns the sum of the averages of the square footage for all tenants.&amp;nbsp; But I'm having trouble adding the conditional so that it only does it if sales exist for 12 full months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sure if someone can help me figure out how to get the average square footages to work I should be able to get the sales formula to work in order to get my PSF number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if anyone has any tips for how my formula is wrong?&amp;nbsp; Or suggestions for a modification to my script?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 11:33:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-aggregate-averages/m-p/460026#M561496</guid>
      <dc:creator />
      <dc:date>2013-03-20T11:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: sum aggregate averages</title>
      <link>https://community.qlik.com/t5/QlikView/sum-aggregate-averages/m-p/460027#M561497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe like this: SUM({&amp;lt;Tenant={"=count(distinct Month)=12"}&amp;gt;} AGGR(AVG(SquareFootage), Mall, Tenant))&lt;/P&gt;&lt;P&gt;If not, please post a sample document or sample data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 11:40:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-aggregate-averages/m-p/460027#M561497</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-03-20T11:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: sum aggregate averages</title>
      <link>https://community.qlik.com/t5/QlikView/sum-aggregate-averages/m-p/460028#M561498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That does it. Thanks, I didn't think about using set analysis for it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 11:44:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-aggregate-averages/m-p/460028#M561498</guid>
      <dc:creator />
      <dc:date>2013-03-20T11:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: sum aggregate averages</title>
      <link>https://community.qlik.com/t5/QlikView/sum-aggregate-averages/m-p/460029#M561499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now that worked when I had a single year selected.&amp;nbsp; but doesn't work when there are multiple years. any thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 12:02:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-aggregate-averages/m-p/460029#M561499</guid>
      <dc:creator />
      <dc:date>2013-03-20T12:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: sum aggregate averages</title>
      <link>https://community.qlik.com/t5/QlikView/sum-aggregate-averages/m-p/460030#M561500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i created a sample qvw to try to demonstrate my issue in more detail.&amp;nbsp; the formula above worked great when only one year was selected.&amp;nbsp; but i am using set analysis in my charts to show certain years regardless of what is selected.&amp;nbsp; see attached file, hopefully that helps you help me &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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update: this isn't in the attached file, but i am getting pretty close by changing the formula to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Tenant={"=aggr(count(distinct MonthYear),Mall,Tenant,Year)=12"}&amp;gt;}&lt;/P&gt;&lt;P&gt;aggr(avg(SF),Year,Mall,Tenant))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i think it's requiring that the tenants are there for 12 months for each of the years that i select.&amp;nbsp; &lt;/P&gt;&lt;P&gt;But if I'm selecting 2010, 2011 and 2012, and a tenant has 12 months of sales in 2011 only, then I want to show their avgSF in that year only.&amp;nbsp; but i think since it doesn't have 12 months in all three of those years, it's excluding their SF completely from all years.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 12:32:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-aggregate-averages/m-p/460030#M561500</guid>
      <dc:creator />
      <dc:date>2013-03-20T12:32:33Z</dc:date>
    </item>
  </channel>
</rss>

