<?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: Calculation of average in straight table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924041#M319886</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it doesnt work&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Jul 2015 12:47:59 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-07-31T12:47:59Z</dc:date>
    <item>
      <title>Calculation of average in straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924033#M319878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, guys!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem with avg() function in my pivot table. It doesnt seem to work correctly.&lt;/P&gt;&lt;P&gt;I need to calculate average of values for the months picked in filter, for example from January till July.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Here's the sample information of&amp;nbsp; employee:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 284px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="137"&gt;Emp_name&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="73"&gt;Bench_Data&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="74"&gt;Month_Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;John Smith&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;1.00&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;Jan-15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;John Smith&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;1.00&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;Feb-15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;John Smith&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;1.00&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;Mar-15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;John Smith&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;1.00&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;Apr-15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;John Smith&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;0.72&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;May-15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;John Smith&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;0.75&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;Jun-15&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you see there's no value in July, so instead of average = 0,78, I get 0,91 in my table. Thus, it counts average of months that has&amp;nbsp; values,&amp;nbsp; in this example from January till June, and I want it to count from January till July.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I fix it, guys?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 12:27:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924033#M319878</guid>
      <dc:creator />
      <dc:date>2015-07-31T12:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of average in straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924034#M319879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How should Qlikview know that you want to count from january till july and not for example from january till october?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps sum(Bench_Data)/num(Month(Today())) does what you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 12:31:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924034#M319879</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-07-31T12:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of average in straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924035#M319880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an expression in my table Avg(Bench_Data). And whenever I want to see average for a distinct period of time I pick months in the filter named "Months"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 12:33:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924035#M319880</guid>
      <dc:creator />
      <dc:date>2015-07-31T12:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of average in straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924036#M319881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=SUM(Bench_Data)/COUNT({1}TOTAL DISTINCT Month_Date)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 12:34:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924036#M319881</guid>
      <dc:creator>trpatel123</dc:creator>
      <dc:date>2015-07-31T12:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of average in straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924037#M319882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I dont want to count the average for entire year, I want to count the average picked in the filter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 12:37:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924037#M319882</guid>
      <dc:creator />
      <dc:date>2015-07-31T12:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of average in straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924038#M319883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Diana, maybe:&lt;/P&gt;&lt;P&gt;Sum(Bench_Data)/GetPossibleCount(Month_Date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;Sum(Bench_Data)/COUNT(TOTAL DISTINCT Month_Date)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 12:40:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924038#M319883</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-07-31T12:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of average in straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924039#M319884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;try like this &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=SUM(Bench_Data)/COUNT(DISTINCT Month_Date)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=aggr(Avg(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Bench_Data&lt;/SPAN&gt;),&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Month_Date&lt;/SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 12:41:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924039#M319884</guid>
      <dc:creator>sunilkumarqv</dc:creator>
      <dc:date>2015-07-31T12:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of average in straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924040#M319885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure your Month_Date field contains date values, not string values. Then you can select the months and calculate the number of months with Month(max(Month_Date)) and Month(Min(Month_Date)) and subtract these two values, for example in a variable: vNoOfMonths: =1+&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Month(max(Month_Date))-Month(Min(Month_Date)).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Your expression could then be something like sum(Bench_Data)/$(vNoOfMonths). &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 12:45:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924040#M319885</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-07-31T12:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of average in straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924041#M319886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it doesnt work&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 12:47:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924041#M319886</guid>
      <dc:creator />
      <dc:date>2015-07-31T12:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of average in straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924042#M319887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bingooooo!!! That works perfectly! Thank you for your smart idea!!&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, 31 Jul 2015 12:55:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-average-in-straight-table/m-p/924042#M319887</guid>
      <dc:creator />
      <dc:date>2015-07-31T12:55:45Z</dc:date>
    </item>
  </channel>
</rss>

