<?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 Sum and average of derived expression? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-and-average-of-derived-expression/m-p/465194#M569334</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I would like to get sum, mean, standard deviation and count from a derived expression. I tried many different ways, still cannot figure it out by myslef. Please refer to the sample project in the attachment. Any helps will be highly appreciated!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Longmatch&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Oct 2012 19:58:14 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-10-03T19:58:14Z</dc:date>
    <item>
      <title>Sum and average of derived expression?</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-and-average-of-derived-expression/m-p/465194#M569334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I would like to get sum, mean, standard deviation and count from a derived expression. I tried many different ways, still cannot figure it out by myslef. Please refer to the sample project in the attachment. Any helps will be highly appreciated!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Longmatch&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2012 19:58:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-and-average-of-derived-expression/m-p/465194#M569334</guid>
      <dc:creator />
      <dc:date>2012-10-03T19:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sum and average of derived expression?</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-and-average-of-derived-expression/m-p/465195#M569335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe you can get your results using advanced aggregation, using expressions in your text box like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;= 'Total&amp;nbsp; moving range is: ' &amp;amp; sum(aggr(fabs(count(ID)-above(count(ID))),Month))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;= 'Average of moving range is: ' &amp;amp; avg(aggr(fabs(count(ID)-above(count(ID))),Month)) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will run into one issue here: aggr() function sorts its dimension values by load order, and load order for Month is mixed up, not in chronological order, for your input data. You can see this if you create a list box for Month and set sort order to load order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can correct this is by reading in your Month sorted, if this is not possible, you can create all field values of Month ordered correctly as first load in the script, creating the correct load order. After loading in your data, you can drop the field (only from the first table), if you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached for my solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2012 09:43:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-and-average-of-derived-expression/m-p/465195#M569335</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-10-04T09:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sum and average of derived expression?</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-and-average-of-derived-expression/m-p/465196#M569336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what I need, it just works perfectly. Thank you very much. I only need average, standard deviation and sum, so the order is not issue. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2012 10:53:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-and-average-of-derived-expression/m-p/465196#M569336</guid>
      <dc:creator />
      <dc:date>2012-10-04T10:53:29Z</dc:date>
    </item>
  </channel>
</rss>

