<?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: Calculating overall averages in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculating-overall-averages/m-p/407793#M151700</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;avg({1} total Patients)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But yeah, we're kind of shooting in the dark.&amp;nbsp; As Jonathan suggests, if you really want an answer, post a sample application.&amp;nbsp; This would be trivial to solve if we had the right information.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Oct 2012 23:33:40 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2012-10-12T23:33:40Z</dc:date>
    <item>
      <title>Calculating overall averages</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-overall-averages/m-p/407787#M151694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose I have the following dataset:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Practice&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Patients&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1000&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2000&lt;/P&gt;&lt;P&gt;C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's the formula I need to be able to refer to the OVERALL average for the entire dataset?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I plan to use this to format the cell backgrounds accordingly so that practices A and B would be green as they are below the 3000 average and practice C would be red as they are above the overall 3000 average.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know how to do the formatting bit, just can't get the equation right to calculate the overall average.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 09:16:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-overall-averages/m-p/407787#M151694</guid>
      <dc:creator />
      <dc:date>2012-10-12T09:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating overall averages</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-overall-averages/m-p/407788#M151695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;avg({1} Patients)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work I think&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 09:28:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-overall-averages/m-p/407788#M151695</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-12T09:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating overall averages</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-overall-averages/m-p/407789#M151696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Johannes but unfortunately this hasn't worked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 09:49:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-overall-averages/m-p/407789#M151696</guid>
      <dc:creator />
      <dc:date>2012-10-12T09:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating overall averages</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-overall-averages/m-p/407790#M151697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the absence of information why Johannes' selection does not work or details of your data structure, I guess that you need something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Avg({1} Aggr(Count(Patients), Practice))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 09:59:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-overall-averages/m-p/407790#M151697</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-10-12T09:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating overall averages</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-overall-averages/m-p/407791#M151698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again, Jonathan but, this hasn't worked either.&lt;BR /&gt;Assume the data is exactly as in the original post and I've formatted as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PATIENTS&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Avg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({1} &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Patients&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Practice&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)),&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;RGB&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(255,0,0),&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;RGB&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(0,255,0)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, all the cells show green.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 10:07:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-overall-averages/m-p/407791#M151698</guid>
      <dc:creator />
      <dc:date>2012-10-12T10:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating overall averages</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-overall-averages/m-p/407792#M151699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly - QV field names are case sensitive, so should the field be PATIENTS or Patients? This expression will fail because one of the two sides of the compare will be an error and treated as null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondly - are you doing this in a straight/pivot table or chart? If so, what dimensions are you using? This may mean that PATIENTS has no dtisinct value, but you are comparing a field value with a count of fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you say that the data structure is like the table in the initial post, then the first expression is certainly correct, but I suspect the problem is in the comparison expression - but I am just guessing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you post your application or a sample of it, then someone may be able to assist without wild guesses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 10:54:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-overall-averages/m-p/407792#M151699</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-10-12T10:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating overall averages</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-overall-averages/m-p/407793#M151700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;avg({1} total Patients)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But yeah, we're kind of shooting in the dark.&amp;nbsp; As Jonathan suggests, if you really want an answer, post a sample application.&amp;nbsp; This would be trivial to solve if we had the right information.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 23:33:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-overall-averages/m-p/407793#M151700</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2012-10-12T23:33:40Z</dc:date>
    </item>
  </channel>
</rss>

