<?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: Aggregated average based on firstsortedvalue - Help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30234#M787551</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From 555508 and 566864 for Vehicle A in November, how are you getting 12167 in the second table?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Feb 2018 14:23:08 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-02-15T14:23:08Z</dc:date>
    <item>
      <title>Aggregated average based on firstsortedvalue - Help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30231#M787548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me I am struggling with calculation of aggregated average.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have data like this representing the mileage at different point of time for different vehicles.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vehicle Date-Time&amp;nbsp; Mileage&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See data enclosed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to have one calculation representing the average mileage for our population based on first and last date of the month for each vehicle.&lt;/P&gt;&lt;P&gt;For example : 5th June vehicle A has 10.000 km 25th June it has 15.000 km it drove 5000 km in 20 days so avg mileage per month is 30*5000/20 = 7500 km/month&amp;nbsp; (if the vehicle has data between these 2 dates we ignore them, we just want to know the first and last date of each month per vehicle)&lt;/P&gt;&lt;P&gt;8th of June vehicle B has 8.000 km and 15th of June it has 10.000km so average is 30*2000/7=8571 km/month&lt;/P&gt;&lt;P&gt;So for both vehicle average mileage in June is 8035 (7500+8571/2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This 8035 I would like to calculate it in a single formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help me&amp;nbsp; and apply the same logic to my data ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In advance thanks for your help&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/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30231#M787548</guid>
      <dc:creator>Hakim-A</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregated average based on firstsortedvalue - Help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30232#M787549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the expected output based on the sample you have provided?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 13:09:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30232#M787549</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-15T13:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregated average based on firstsortedvalue - Help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30233#M787550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" height="207" src="https://community.qlik.com/legacyfs/online/193509_pastedImage_0.png" style="width: 855.6px; height: 207px;" width="856" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically what I need to have is the last 2 results/tables on the right.&lt;/P&gt;&lt;P&gt;Here I represented the different calculation step to retrieve average per vehicle and per month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 13:26:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30233#M787550</guid>
      <dc:creator>Hakim-A</dc:creator>
      <dc:date>2018-02-15T13:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregated average based on firstsortedvalue - Help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30234#M787551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From 555508 and 566864 for Vehicle A in November, how are you getting 12167 in the second table?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 14:23:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30234#M787551</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-15T14:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregated average based on firstsortedvalue - Help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30235#M787552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;30*(566864-555508)/(28)&lt;/P&gt;&lt;P&gt;28 represents the days difference between 1/11 and 29/11&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 16:21:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30235#M787552</guid>
      <dc:creator>Hakim-A</dc:creator>
      <dc:date>2018-02-15T16:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregated average based on firstsortedvalue - Help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30236#M787553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Avg(Aggr((FirstSortedValue(VALUE, -READOUT_DATETIME) - FirstSortedValue(VALUE, READOUT_DATETIME)) * 30/(Max(DATE) - Min(DATE)), Vehicle, MonthYear))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/193554_Capture.PNG" style="height: 169px; width: 620px;" /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 16:29:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30236#M787553</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-15T16:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregated average based on firstsortedvalue - Help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30237#M787554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you I adapted the formula a little bit and it is working perfectly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 18:41:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30237#M787554</guid>
      <dc:creator>Hakim-A</dc:creator>
      <dc:date>2018-02-15T18:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregated average based on firstsortedvalue - Help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30238#M787555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome &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, 15 Feb 2018 18:54:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30238#M787555</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-15T18:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregated average based on firstsortedvalue - Help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30239#M787556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another question linked to this exercise&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What if I want to display the latest value of this aggregation in a table&lt;/P&gt;&lt;P&gt;Of course last month can be different for each vehicle&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vehicle&amp;nbsp;&amp;nbsp; Last month mileage&lt;/P&gt;&lt;P&gt;A&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; 7135&lt;/P&gt;&lt;P&gt;B&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; 8086&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 19:12:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30239#M787556</guid>
      <dc:creator>Hakim-A</dc:creator>
      <dc:date>2018-02-15T19:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregated average based on firstsortedvalue - Help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30240#M787557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The idea is to have the avg monthly mileage per vehicle but also the latest month mileage to see if there is any deviation&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 19:14:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30240#M787557</guid>
      <dc:creator>Hakim-A</dc:creator>
      <dc:date>2018-02-15T19:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregated average based on firstsortedvalue - Help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30241#M787558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstSortedValue(Aggr((FirstSortedValue(VALUE, -READOUT_DATETIME) - FirstSortedValue(VALUE, READOUT_DATETIME)) * 30/(Max(DATE) - Min(DATE)), Vehicle, MonthYear), -Aggr(Max(READOUT_DATETIME), Vehicle, MonthYear))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/193558_Capture.PNG" style="height: 240px; width: 620px;" /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 19:20:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30241#M787558</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-15T19:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregated average based on firstsortedvalue - Help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30242#M787559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for this reactive support&lt;/P&gt;&lt;P&gt;Much appreciated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Feb 2018 15:38:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregated-average-based-on-firstsortedvalue-Help/m-p/30242#M787559</guid>
      <dc:creator>Hakim-A</dc:creator>
      <dc:date>2018-02-16T15:38:59Z</dc:date>
    </item>
  </channel>
</rss>

