<?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 Function: Pivot vs Straight table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Avg-Function-Pivot-vs-Straight-table/m-p/1165046#M909687</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the feedback. I want to make sure I'm explaining myself correctly, see attached. My pivot table and straight table averages match each other, it's the overall totals that differ. Why is that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Jun 2016 16:43:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-06-21T16:43:56Z</dc:date>
    <item>
      <title>Avg Function: Pivot vs Straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-Function-Pivot-vs-Straight-table/m-p/1165042#M909683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an Avg expression in both of my charts, a Pivot and Straight table. I'm having issues with the totals. I would like the total of the Pivot table to match the (correct total Avg) of the straight table. From the research I've done, it seems that the Pivot table does not have the option to create totals, just partial totals. Is there a way that I can adjust my expression to get a final total that matches each table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;avg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Avg_Person_days&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-Function-Pivot-vs-Straight-table/m-p/1165042#M909683</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Avg Function: Pivot vs Straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-Function-Pivot-vs-Straight-table/m-p/1165043#M909684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi MrJohn,&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The best thing to do in your pivot table is to get an expression that sums to the total and divide by one that gives the count. The trick would be the use of the TOTAL qualifier in the second expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use TOTAL and where necessary use a list of field names too that will tell the expression which dimensions to respect, otherwise TOTAL will disregard all the chart dimensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll have something like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum( ....) / Count(TOTAL &amp;lt;field1, field2,...&amp;gt; ...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you post some data I or someone else will make it clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 15:46:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-Function-Pivot-vs-Straight-table/m-p/1165043#M909684</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2016-06-21T15:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Avg Function: Pivot vs Straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-Function-Pivot-vs-Straight-table/m-p/1165044#M909685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, yes an example would be great. See below for a list of dimensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pivot Dimensions:&lt;/P&gt;&lt;P&gt;Region&lt;/P&gt;&lt;P&gt;Division&lt;/P&gt;&lt;P&gt;Program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression: Avg(Avg_Days)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Avg_FirstVisit_Days&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: #0000ff; font-size: 8pt;"&gt;TOTAL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Division&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;REGION&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PROGRAM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Avg_FirstVisit_Days&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;BR /&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 15:57:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-Function-Pivot-vs-Straight-table/m-p/1165044#M909685</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-21T15:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Avg Function: Pivot vs Straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-Function-Pivot-vs-Straight-table/m-p/1165045#M909686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;Avg_Days seems an odd name for a field -especially one you trying to find an average of.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;We could use an expression like&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(Avg_Days) / Count(&lt;EM&gt;something&lt;/EM&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know what a good denominator would be without knowing more about your data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example if I wanted to know the average size of some orders I would use an expression like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum([Order Value]) / Count(OrderID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;OrderID &lt;/SPAN&gt;would not be a dimension in my chart. For your example I need to know what you mean by average.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum of &lt;EM&gt;what&lt;/EM&gt; / count of &lt;EM&gt;what&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 16:21:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-Function-Pivot-vs-Straight-table/m-p/1165045#M909686</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2016-06-21T16:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Avg Function: Pivot vs Straight table</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-Function-Pivot-vs-Straight-table/m-p/1165046#M909687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the feedback. I want to make sure I'm explaining myself correctly, see attached. My pivot table and straight table averages match each other, it's the overall totals that differ. Why is that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 16:43:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-Function-Pivot-vs-Straight-table/m-p/1165046#M909687</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-21T16:43:56Z</dc:date>
    </item>
  </channel>
</rss>

