<?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: How to subtract the Average of each group from latest value? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344689#M620060</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for helping me with this &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yeah!! It's working good, how can I select the record (Amount) which is latest in Date and subtract it with your expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have no idea how to pick it that record.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Apr 2017 14:17:50 GMT</pubDate>
    <dc:creator>mohan_1105</dc:creator>
    <dc:date>2017-04-19T14:17:50Z</dc:date>
    <item>
      <title>How to subtract the Average of each group from latest value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344687#M620058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to calculate the average sales amount of each group and this is subtracted from the latest bill amount. Like I showed below in the image,&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/160520_Capture.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;I tried in many ways to get the answer but I got the wrong answers. I used the following expression.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Aggr(avg(NETAMT),CUSTOMER)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Aggr(avg(sum(NETAMT)),CUSTOMER)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Avg(Aggr(sum(NETAMT),CUSTOMER))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Apr 2017 13:59:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344687#M620058</guid>
      <dc:creator>mohan_1105</dc:creator>
      <dc:date>2017-04-19T13:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract the Average of each group from latest value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344688#M620059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this to find the average&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Avg(TOTAL &amp;lt;Group&amp;gt; Aggr(Sum(NETAMT), Group, DATE))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Apr 2017 14:09:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344688#M620059</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-04-19T14:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract the Average of each group from latest value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344689#M620060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for helping me with this &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yeah!! It's working good, how can I select the record (Amount) which is latest in Date and subtract it with your expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have no idea how to pick it that record.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Apr 2017 14:17:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344689#M620060</guid>
      <dc:creator>mohan_1105</dc:creator>
      <dc:date>2017-04-19T14:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract the Average of each group from latest value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344690#M620061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstSortedValue(Aggr(Sum(NETAMT), Group, DATE), -Aggr(DATE, Group, DATE))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Apr 2017 14:19:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344690#M620061</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-04-19T14:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract the Average of each group from latest value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344691#M620062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It isn't working. Output are same as the Amount column.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Apr 2017 14:29:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344691#M620062</guid>
      <dc:creator>mohan_1105</dc:creator>
      <dc:date>2017-04-19T14:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract the Average of each group from latest value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344692#M620063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have both Group and DATE as your chart dimensions where you are trying this? or do you just have Group as a dimension?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Apr 2017 14:35:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344692#M620063</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-04-19T14:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract the Average of each group from latest value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344693#M620064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, Both Group and vDATE are in dimensions and I am trying to find latest sales made by each group is above their respective group average. Also, sample file is attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 04:45:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344693#M620064</guid>
      <dc:creator>mohan_1105</dc:creator>
      <dc:date>2017-04-20T04:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract the Average of each group from latest value?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344694#M620065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think your date field is not correctly read as date by Qlik Sense.... you can try this as a work around&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstSortedValue(TOTAL &amp;lt;Group&amp;gt; Amount, -Date#(ORDERDATE, 'D/M/YYYY'))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I suggest fixing your &lt;STRONG style="font-size: 13.3333px;"&gt;ORDERDATE&lt;/STRONG&gt; in the script&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2954"&gt;Why don’t my dates work?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2622"&gt;Get the Dates Right&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 08:56:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-the-Average-of-each-group-from-latest-value/m-p/1344694#M620065</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-04-20T08:56:15Z</dc:date>
    </item>
  </channel>
</rss>

