<?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: Re: troubles in getting averages per dimensions in pivot chart in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508994#M549643</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If that's your definition of a weighted average then you might as well use simply &lt;EM&gt;count(OrderLine)/count(total &amp;lt;Month&amp;gt; OrderLine) &lt;/EM&gt;as expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought you wanted the average of the month values: &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;weighted average(33%;100%;50%). That's what my first expression calculates.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Dec 2013 15:22:23 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2013-12-19T15:22:23Z</dc:date>
    <item>
      <title>troubles in getting averages per dimensions in pivot chart</title>
      <link>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508988#M549637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a datatable which looks somewhat like the following&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;OrderLine&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Category&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Month&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1111&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;on time&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Jan&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1112&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;on time&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Jan&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1113&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;delay&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Jan&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1114&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;delay&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Feb&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1115&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;delay&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Feb&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1116&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;delay&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Mar&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1117&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;delay&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Mar&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1118&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;on time&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Mar&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1119&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;on time&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Mar&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The end result that I would like to obtain in a pivot table in QV is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="75" style="border: 1px solid rgb(0, 0, 0); width: 611px; height: 75px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Jan&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Feb&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Mar&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Average&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;delay&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;33%&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100%&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50%&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;weighted average(33%;100%;50%)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;on time&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;66%&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0%&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50%&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;weighted average(66%;0%;50%)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the result is pretty self explanatory.&lt;/P&gt;&lt;P&gt;I can get this with absolute values (i.e., counting of lines)&lt;/P&gt;&lt;P&gt;but as soon as I try the avg() function, either with or without Dimensionality(), I either get 100% everywhere or no values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please someone help me out,&amp;nbsp; it would be so much appreciated!!&lt;/P&gt;&lt;P&gt;thank you so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 13:55:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508988#M549637</guid>
      <dc:creator />
      <dc:date>2013-12-19T13:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: troubles in getting averages per dimensions in pivot chart</title>
      <link>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508989#M549638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erik&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you doing avg(OrderLine) ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 14:03:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508989#M549638</guid>
      <dc:creator />
      <dc:date>2013-12-19T14:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: troubles in getting averages per dimensions in pivot chart</title>
      <link>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508990#M549639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yeah, i also tried this one amongst other formulas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should that be the good one?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 14:04:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508990#M549639</guid>
      <dc:creator />
      <dc:date>2013-12-19T14:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: troubles in getting averages per dimensions in pivot chart</title>
      <link>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508991#M549640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached qvw&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 14:28:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508991#M549640</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-12-19T14:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: troubles in getting averages per dimensions in pivot chart</title>
      <link>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508992#M549641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Gysbert!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is working almost perfectly; only, the total averages part is giving wrong results.&lt;/P&gt;&lt;P&gt;With the formula you input, the total averages per month are averaged, regardless of the number of lines.&lt;/P&gt;&lt;P&gt;Meanwhile I would like to have the average for the whole amount of lines, regardless of the months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope I made myself clear and thanks for your input!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 15:04:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508992#M549641</guid>
      <dc:creator />
      <dc:date>2013-12-19T15:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Re: troubles in getting averages per dimensions in pivot chart</title>
      <link>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508993#M549642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I came up with this piece of script and it seems working as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone please confirm if it is valid?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13874657260618011" jivemacro_uid="_13874657260618011" modifiedtitle="true"&gt;
&lt;P&gt;if(SecondaryDimensionality()=1,&lt;/P&gt;
&lt;P&gt;count(OrderLine)/count(total &amp;lt;Month&amp;gt; OrderLine),&lt;/P&gt;
&lt;P&gt;sum(aggr(count(OrderLine)/count(total OrderLine),Category))&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 15:08:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508993#M549642</guid>
      <dc:creator />
      <dc:date>2013-12-19T15:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Re: troubles in getting averages per dimensions in pivot chart</title>
      <link>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508994#M549643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If that's your definition of a weighted average then you might as well use simply &lt;EM&gt;count(OrderLine)/count(total &amp;lt;Month&amp;gt; OrderLine) &lt;/EM&gt;as expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought you wanted the average of the month values: &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;weighted average(33%;100%;50%). That's what my first expression calculates.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 15:22:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508994#M549643</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-12-19T15:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Re: troubles in getting averages per dimensions in pivot chart</title>
      <link>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508995#M549644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I admit that I have sometimes troubles in expressing what I really want/need and I perhaps take a more complicated than necessary route.&lt;/P&gt;&lt;P&gt;But I thought, in this case, that the "weighted average" term was the most appropriate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;[...] where instead of each of the data points contributing equally to the final average, some data points contribute more than others.&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so, if Feb has less line than Mar, it will count less.&lt;/P&gt;&lt;P&gt;But indeed, "average of the total" would have been an easier way of saying.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And indeed, the formula reported by you work as expected!&lt;/P&gt;&lt;P&gt;thank you &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 15:52:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/troubles-in-getting-averages-per-dimensions-in-pivot-chart/m-p/508995#M549644</guid>
      <dc:creator />
      <dc:date>2013-12-19T15:52:09Z</dc:date>
    </item>
  </channel>
</rss>

