<?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: Average calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Average-calculation/m-p/1575429#M739752</link>
    <description>&lt;P&gt;Check using below code,&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;Temp:&lt;BR /&gt;Load *&lt;BR /&gt;INLINE [&lt;BR /&gt;Vintage, Value&lt;BR /&gt;A, 10&lt;BR /&gt;A, 9&lt;BR /&gt;A, 4.5&lt;BR /&gt;A, 5,&lt;BR /&gt;B, 1,&lt;BR /&gt;B,4,&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Temp2:&lt;BR /&gt;LOAD *,&lt;BR /&gt;if(Previous(Vintage)=Vintage ,peek('Row')+1,1) As Row&lt;BR /&gt;Resident Temp Order by Vintage;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Temp3:&lt;BR /&gt;Load Max(Row) as Row,Vintage,Max(Row)&amp;amp;Vintage as key1 Resident Temp2 Group By Vintage;&lt;BR /&gt;Concatenate&lt;BR /&gt;LOAD Vintage, Value,Row Resident Temp2 Where NOT Exists(key1,Row&amp;amp;Vintage);&lt;/P&gt;&lt;P&gt;Drop Field Row,key1;&lt;/P&gt;&lt;P&gt;Main:&lt;BR /&gt;Load Avg(Value) as Avg, Vintage Resident Temp3 Group By Vintage;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DROP Tables Temp,Temp2,Temp3;&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;Try this, its done in script.&lt;/P&gt;&lt;P&gt;PFA app For ref.&lt;/P&gt;</description>
    <pubDate>Wed, 01 May 2019 08:53:49 GMT</pubDate>
    <dc:creator>HirisH_V7</dc:creator>
    <dc:date>2019-05-01T08:53:49Z</dc:date>
    <item>
      <title>Average calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculation/m-p/1575410#M739751</link>
      <description>&lt;P&gt;Below is the data set , I need average below table for each vintage. Below is the only one vintage I want to average the value by excluding last value i.e: 5 .After excluding I need average in qlik.&lt;/P&gt;&lt;P&gt;I can able to get total average by using below formula&lt;/P&gt;&lt;P&gt;Avg( Aggr(rangesum( above(-sum(Value),0,Max(Vintage))),Vintage))&lt;/P&gt;&lt;P&gt;Total Avg : 7.125&lt;/P&gt;&lt;P&gt;After excluding 5 , Avg is : 7.83 ( &lt;STRONG&gt;I need out put this&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;Can any one help me on this&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Vintage&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;4.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculation/m-p/1575410#M739751</guid>
      <dc:creator>malyadri1004</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculation/m-p/1575429#M739752</link>
      <description>&lt;P&gt;Check using below code,&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;Temp:&lt;BR /&gt;Load *&lt;BR /&gt;INLINE [&lt;BR /&gt;Vintage, Value&lt;BR /&gt;A, 10&lt;BR /&gt;A, 9&lt;BR /&gt;A, 4.5&lt;BR /&gt;A, 5,&lt;BR /&gt;B, 1,&lt;BR /&gt;B,4,&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Temp2:&lt;BR /&gt;LOAD *,&lt;BR /&gt;if(Previous(Vintage)=Vintage ,peek('Row')+1,1) As Row&lt;BR /&gt;Resident Temp Order by Vintage;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Temp3:&lt;BR /&gt;Load Max(Row) as Row,Vintage,Max(Row)&amp;amp;Vintage as key1 Resident Temp2 Group By Vintage;&lt;BR /&gt;Concatenate&lt;BR /&gt;LOAD Vintage, Value,Row Resident Temp2 Where NOT Exists(key1,Row&amp;amp;Vintage);&lt;/P&gt;&lt;P&gt;Drop Field Row,key1;&lt;/P&gt;&lt;P&gt;Main:&lt;BR /&gt;Load Avg(Value) as Avg, Vintage Resident Temp3 Group By Vintage;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DROP Tables Temp,Temp2,Temp3;&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;Try this, its done in script.&lt;/P&gt;&lt;P&gt;PFA app For ref.&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 08:53:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculation/m-p/1575429#M739752</guid>
      <dc:creator>HirisH_V7</dc:creator>
      <dc:date>2019-05-01T08:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculation/m-p/1575441#M739753</link>
      <description>&lt;P&gt;In UI Level some thing like this,&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;Script:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;Temp:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;Load *&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;INLINE [&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;Vintage, Value&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;A, 10&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;A, 9&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;A, 4.5&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;A, 5,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;B, 1,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;B,4,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;];&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;Temp2:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;LOAD *,if(Previous(Vintage)=Vintage ,peek('Row')+1,1)&amp;amp;Vintage as Supress,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;if(Previous(Vintage)=Vintage ,peek('Row')+1,1) As Row&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;Resident Temp Order by Vintage;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;DROP Table Temp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;Exit SCRIPT;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;In UI:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;Avg({&amp;lt;Supress-={$(=Concat(Aggr(chr(39)&amp;amp;max(Row)&amp;amp;Vintage&amp;amp;chr(39),Vintage),','))}&amp;gt;}Value)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;PFA&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;For ref&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 10:51:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculation/m-p/1575441#M739753</guid>
      <dc:creator>HirisH_V7</dc:creator>
      <dc:date>2019-05-01T10:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculation/m-p/1575444#M739754</link>
      <description>&lt;P&gt;Hi Harish, Can you please provide file in &lt;STRONG&gt;.qvf. &lt;/STRONG&gt;As I am unable to open your file my server is Qliksense&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 11:07:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculation/m-p/1575444#M739754</guid>
      <dc:creator>malyadri1004</dc:creator>
      <dc:date>2019-05-01T11:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculation/m-p/1575456#M739755</link>
      <description>&lt;P&gt;Wow, that is one complicated expression to calculate Average... did this not work for a simple average&lt;BR /&gt;Avg(Value)?&lt;/P&gt;&lt;P&gt;For the main question, do you always want to exclude the last value within a specific vintage? May be this&lt;BR /&gt;Avg(Aggr(If(RowNo() &amp;lt;&amp;gt; NoOfRows(), Value), Vintage, Value))&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 11:37:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculation/m-p/1575456#M739755</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-05-01T11:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculation/m-p/1575462#M739756</link>
      <description>&lt;P&gt;Hi Sunny Talwar,&amp;nbsp; Yes I need to exclude the last value within a specific vintage , But your formula didn't work in Qliksense&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 11:54:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculation/m-p/1575462#M739756</guid>
      <dc:creator>malyadri1004</dc:creator>
      <dc:date>2019-05-01T11:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculation/m-p/1575465#M739757</link>
      <description>&lt;P&gt;Seem to work okay for me&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/11263i1399B309C6500240/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 11:57:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculation/m-p/1575465#M739757</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-05-01T11:57:38Z</dc:date>
    </item>
  </channel>
</rss>

