<?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: Avg Base calculation in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952579#M78541</link>
    <description>&lt;P&gt;Many Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/146877"&gt;@Andrei_Cusnir&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just now I have understood my requirement, it will really helpful if you provide expressions for the below&lt;/P&gt;
&lt;P&gt;Consider before 202201 Base as 0.&lt;/P&gt;
&lt;P&gt;Base = (Previous Month Base) + Adds - Delete&lt;/P&gt;
&lt;P&gt;Avg of Base = (Previous Month Base + Curent Month Base)/2&lt;/P&gt;
&lt;TABLE width="561px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="62.5469px"&gt;Brand&lt;/TD&gt;
&lt;TD width="105.938px"&gt;Date&lt;/TD&gt;
&lt;TD width="62.5469px"&gt;Adds&lt;/TD&gt;
&lt;TD width="83.7344px"&gt;Deletes&lt;/TD&gt;
&lt;TD width="140.25px"&gt;Base&lt;/TD&gt;
&lt;TD width="104.984px"&gt;Avg of Base&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="62.5469px"&gt;AA&lt;/TD&gt;
&lt;TD width="105.938px"&gt;01.01.2022&lt;/TD&gt;
&lt;TD width="62.5469px"&gt;200&lt;/TD&gt;
&lt;TD width="83.7344px"&gt;100&lt;/TD&gt;
&lt;TD width="140.25px"&gt;100 (0+200-100)&lt;/TD&gt;
&lt;TD width="104.984px"&gt;50 (0+100/2)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="62.5469px"&gt;AA&lt;/TD&gt;
&lt;TD width="105.938px"&gt;01.02.2022&lt;/TD&gt;
&lt;TD width="62.5469px"&gt;300&lt;/TD&gt;
&lt;TD width="83.7344px"&gt;50&lt;/TD&gt;
&lt;TD width="140.25px"&gt;350&lt;/TD&gt;
&lt;TD width="104.984px"&gt;225&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="62.5469px"&gt;AA&lt;/TD&gt;
&lt;TD width="105.938px"&gt;01.03.2022&lt;/TD&gt;
&lt;TD width="62.5469px"&gt;400&lt;/TD&gt;
&lt;TD width="83.7344px"&gt;200&lt;/TD&gt;
&lt;TD width="140.25px"&gt;550&lt;/TD&gt;
&lt;TD width="104.984px"&gt;450&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="62.5469px"&gt;AA&lt;/TD&gt;
&lt;TD width="105.938px"&gt;01.04.2022&lt;/TD&gt;
&lt;TD width="62.5469px"&gt;300&lt;/TD&gt;
&lt;TD width="83.7344px"&gt;150&lt;/TD&gt;
&lt;TD width="140.25px"&gt;700&lt;/TD&gt;
&lt;TD width="104.984px"&gt;625&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="62.5469px"&gt;AA&lt;/TD&gt;
&lt;TD width="105.938px"&gt;01.05.2022&lt;/TD&gt;
&lt;TD width="62.5469px"&gt;350&lt;/TD&gt;
&lt;TD width="83.7344px"&gt;200&lt;/TD&gt;
&lt;TD width="140.25px"&gt;850&lt;/TD&gt;
&lt;TD width="104.984px"&gt;775&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
    <pubDate>Wed, 06 Jul 2022 21:32:27 GMT</pubDate>
    <dc:creator>dhasharadh</dc:creator>
    <dc:date>2022-07-06T21:32:27Z</dc:date>
    <item>
      <title>Avg Base calculation</title>
      <link>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952060#M78487</link>
      <description>&lt;P&gt;Can any one suggest the best way to get the below. I have an year Month field (YYYYMM) in the pivot table and I have to show the Avg Base, below is the sample data. I want to calculate avg Base( last column)&lt;/P&gt;
&lt;TABLE width="310px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="51px"&gt;Brand&lt;/TD&gt;
&lt;TD width="83px"&gt;Date&lt;/TD&gt;
&lt;TD width="43px"&gt;Base&lt;/TD&gt;
&lt;TD width="90px"&gt;Avg Base formula&lt;/TD&gt;
&lt;TD width="43px"&gt;Avg Base&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="51px"&gt;AA&lt;/TD&gt;
&lt;TD width="83px"&gt;01.01.2022&lt;/TD&gt;
&lt;TD width="43px"&gt;500&lt;/TD&gt;
&lt;TD width="90px"&gt;(0+500)/2&lt;/TD&gt;
&lt;TD width="43px"&gt;255&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="51px"&gt;AA&lt;/TD&gt;
&lt;TD width="83px"&gt;01.02.2022&lt;/TD&gt;
&lt;TD width="43px"&gt;600&lt;/TD&gt;
&lt;TD width="90px"&gt;(500+600)/2&lt;/TD&gt;
&lt;TD width="43px"&gt;550&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="51px"&gt;AA&lt;/TD&gt;
&lt;TD width="83px"&gt;01.03.2022&lt;/TD&gt;
&lt;TD width="43px"&gt;700&lt;/TD&gt;
&lt;TD width="90px"&gt;(600+700)/2&lt;/TD&gt;
&lt;TD width="43px"&gt;650&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="51px"&gt;AA&lt;/TD&gt;
&lt;TD width="83px"&gt;01.04.2022&lt;/TD&gt;
&lt;TD width="43px"&gt;800&lt;/TD&gt;
&lt;TD width="90px"&gt;(700+800)/2&lt;/TD&gt;
&lt;TD width="43px"&gt;750&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="51px"&gt;AA&lt;/TD&gt;
&lt;TD width="83px"&gt;01.05.2022&lt;/TD&gt;
&lt;TD width="43px"&gt;900&lt;/TD&gt;
&lt;TD width="90px"&gt;(500+600)/2&lt;/TD&gt;
&lt;TD width="43px"&gt;850&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Wed, 06 Jul 2022 06:35:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952060#M78487</guid>
      <dc:creator>dhasharadh</dc:creator>
      <dc:date>2022-07-06T06:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Avg Base calculation</title>
      <link>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952169#M78497</link>
      <description>&lt;P&gt;I assume that your dimensions are Brand and Date, so that Base really is an aggregation, like Sum(Base). Then you can use the following to get the average of the two rows:&lt;/P&gt;&lt;P&gt;RangeSum(Sum(Base),Above(Sum(Base)))/2&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 07:37:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952169#M78497</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2022-07-06T07:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Avg Base calculation</title>
      <link>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952180#M78501</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try using the expression:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;=(&lt;/STRONG&gt;&lt;SPAN style="color:hsl(30, 75%, 60%);"&gt;&lt;STRONG&gt;Base &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;+ &lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;If&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;IsNull&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;Above&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;TOTAL &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color:hsl(30, 75%, 60%);"&gt;&lt;STRONG&gt;Base&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;)), 0, &lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;Above&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;TOTAL&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;SPAN style="color:hsl(30, 75%, 60%);"&gt;&lt;STRONG&gt;Base&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;)))/2&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an outcome on Straight table and Pivot table. As you can see it correlates with what you mentioned in your custom table.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://lithium-response-prod.s3.us-west-2.amazonaws.com/qlik.response.lithium.com/RESPONSEIMAGE/0940c8a8-ece8-411b-aa33-82d7d4367173.default.PNG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color:hsl(0, 0%, 60%);"&gt;&lt;I&gt;&lt;STRONG&gt;I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, addressed your concerns or at least pointed you in the right direction, please mark it as Accepted Solution to give further visibility to other community members.&amp;nbsp;&lt;/STRONG&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 07:56:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952180#M78501</guid>
      <dc:creator>Andrei_Cusnir</dc:creator>
      <dc:date>2022-07-06T07:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Avg Base calculation</title>
      <link>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952545#M78538</link>
      <description>&lt;P&gt;Many Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/146877"&gt;@Andrei_Cusnir&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Small change in my original requirement. Would be really helpful if you provide exp for the below please.&lt;/P&gt;
&lt;P&gt;Consider before 202201 Base as 0.&lt;/P&gt;
&lt;P&gt;Base = (Previous Month Base) + Adds - Delete&lt;/P&gt;
&lt;P&gt;Avg of Base = (Previous Month Base + Curent Month Base)/2&lt;/P&gt;
&lt;TABLE width="763"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64px"&gt;Brand&lt;/TD&gt;
&lt;TD width="106px"&gt;Date&lt;/TD&gt;
&lt;TD width="64px"&gt;Adds&lt;/TD&gt;
&lt;TD width="85px"&gt;Deletes&lt;/TD&gt;
&lt;TD width="297px"&gt;Base&lt;/TD&gt;
&lt;TD width="146px"&gt;Avg of Base&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64px"&gt;AA&lt;/TD&gt;
&lt;TD width="106px"&gt;01.01.2022&lt;/TD&gt;
&lt;TD width="64px"&gt;200&lt;/TD&gt;
&lt;TD width="85px"&gt;100&lt;/TD&gt;
&lt;TD width="297px"&gt;100 (0+200-100)&lt;/TD&gt;
&lt;TD width="146px"&gt;(100 + 0)/2 = 50&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64px"&gt;AA&lt;/TD&gt;
&lt;TD width="106px"&gt;01.02.2022&lt;/TD&gt;
&lt;TD width="64px"&gt;300&lt;/TD&gt;
&lt;TD width="85px"&gt;50&lt;/TD&gt;
&lt;TD width="297px"&gt;350&lt;/TD&gt;
&lt;TD width="146px"&gt;225&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64px"&gt;AA&lt;/TD&gt;
&lt;TD width="106px"&gt;01.03.2022&lt;/TD&gt;
&lt;TD width="64px"&gt;400&lt;/TD&gt;
&lt;TD width="85px"&gt;200&lt;/TD&gt;
&lt;TD width="297px"&gt;550&lt;/TD&gt;
&lt;TD width="146px"&gt;450&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64px"&gt;AA&lt;/TD&gt;
&lt;TD width="106px"&gt;01.04.2022&lt;/TD&gt;
&lt;TD width="64px"&gt;300&lt;/TD&gt;
&lt;TD width="85px"&gt;150&lt;/TD&gt;
&lt;TD width="297px"&gt;700&lt;/TD&gt;
&lt;TD width="146px"&gt;625&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64px"&gt;AA&lt;/TD&gt;
&lt;TD width="106px"&gt;01.05.2022&lt;/TD&gt;
&lt;TD width="64px"&gt;350&lt;/TD&gt;
&lt;TD width="85px"&gt;200&lt;/TD&gt;
&lt;TD width="297px"&gt;850&lt;/TD&gt;
&lt;TD width="146px"&gt;775&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Wed, 06 Jul 2022 19:54:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952545#M78538</guid>
      <dc:creator>dhasharadh</dc:creator>
      <dc:date>2022-07-06T19:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Avg Base calculation</title>
      <link>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952547#M78539</link>
      <description>&lt;P&gt;Many Thanks for the reply&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6622"&gt;@hic&lt;/a&gt;&amp;nbsp;you are really an inspiration, I love your articles on different topics in Qlik area.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 19:57:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952547#M78539</guid>
      <dc:creator>dhasharadh</dc:creator>
      <dc:date>2022-07-06T19:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Avg Base calculation</title>
      <link>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952579#M78541</link>
      <description>&lt;P&gt;Many Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/146877"&gt;@Andrei_Cusnir&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just now I have understood my requirement, it will really helpful if you provide expressions for the below&lt;/P&gt;
&lt;P&gt;Consider before 202201 Base as 0.&lt;/P&gt;
&lt;P&gt;Base = (Previous Month Base) + Adds - Delete&lt;/P&gt;
&lt;P&gt;Avg of Base = (Previous Month Base + Curent Month Base)/2&lt;/P&gt;
&lt;TABLE width="561px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="62.5469px"&gt;Brand&lt;/TD&gt;
&lt;TD width="105.938px"&gt;Date&lt;/TD&gt;
&lt;TD width="62.5469px"&gt;Adds&lt;/TD&gt;
&lt;TD width="83.7344px"&gt;Deletes&lt;/TD&gt;
&lt;TD width="140.25px"&gt;Base&lt;/TD&gt;
&lt;TD width="104.984px"&gt;Avg of Base&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="62.5469px"&gt;AA&lt;/TD&gt;
&lt;TD width="105.938px"&gt;01.01.2022&lt;/TD&gt;
&lt;TD width="62.5469px"&gt;200&lt;/TD&gt;
&lt;TD width="83.7344px"&gt;100&lt;/TD&gt;
&lt;TD width="140.25px"&gt;100 (0+200-100)&lt;/TD&gt;
&lt;TD width="104.984px"&gt;50 (0+100/2)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="62.5469px"&gt;AA&lt;/TD&gt;
&lt;TD width="105.938px"&gt;01.02.2022&lt;/TD&gt;
&lt;TD width="62.5469px"&gt;300&lt;/TD&gt;
&lt;TD width="83.7344px"&gt;50&lt;/TD&gt;
&lt;TD width="140.25px"&gt;350&lt;/TD&gt;
&lt;TD width="104.984px"&gt;225&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="62.5469px"&gt;AA&lt;/TD&gt;
&lt;TD width="105.938px"&gt;01.03.2022&lt;/TD&gt;
&lt;TD width="62.5469px"&gt;400&lt;/TD&gt;
&lt;TD width="83.7344px"&gt;200&lt;/TD&gt;
&lt;TD width="140.25px"&gt;550&lt;/TD&gt;
&lt;TD width="104.984px"&gt;450&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="62.5469px"&gt;AA&lt;/TD&gt;
&lt;TD width="105.938px"&gt;01.04.2022&lt;/TD&gt;
&lt;TD width="62.5469px"&gt;300&lt;/TD&gt;
&lt;TD width="83.7344px"&gt;150&lt;/TD&gt;
&lt;TD width="140.25px"&gt;700&lt;/TD&gt;
&lt;TD width="104.984px"&gt;625&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="62.5469px"&gt;AA&lt;/TD&gt;
&lt;TD width="105.938px"&gt;01.05.2022&lt;/TD&gt;
&lt;TD width="62.5469px"&gt;350&lt;/TD&gt;
&lt;TD width="83.7344px"&gt;200&lt;/TD&gt;
&lt;TD width="140.25px"&gt;850&lt;/TD&gt;
&lt;TD width="104.984px"&gt;775&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Wed, 06 Jul 2022 21:32:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952579#M78541</guid>
      <dc:creator>dhasharadh</dc:creator>
      <dc:date>2022-07-06T21:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Avg Base calculation</title>
      <link>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952658#M78547</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There might be some mistakes with the calculations that you have provided so I wanted to share with you here just in case there is an issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on the column &lt;SPAN style="color:hsl(30, 75%, 60%);"&gt;&lt;STRONG&gt;Base&lt;/STRONG&gt;&lt;/SPAN&gt;, the first record is &lt;STRONG&gt;100 &lt;/STRONG&gt;because&lt;STRONG&gt; (0+200-100)&lt;/STRONG&gt;. The 0 is 0, because before that record, there are no any details, so we assume that&lt;STRONG&gt; Null - Null = 0&lt;/STRONG&gt;, hence&lt;SPAN style="color:hsl(120, 75%, 60%);"&gt;&lt;STRONG&gt; Null - Null + 200 - 100&lt;/STRONG&gt;&lt;/SPAN&gt; is &lt;STRONG&gt;100&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the 2nd record I can see correct value: &lt;SPAN style="color:hsl(120, 75%, 60%);"&gt;&lt;STRONG&gt;200 - 100 (Previous Base) + 300 - 50 (Current Base)&lt;/STRONG&gt;&lt;/SPAN&gt;, hence 100 + 250 = 350. For the next record though we have &lt;STRONG&gt;300 - 50 + 400 - 200 = 250 + 200 = &lt;/STRONG&gt;&lt;SPAN style="color:hsl(120, 75%, 60%);"&gt;&lt;STRONG&gt;450&lt;/STRONG&gt;&lt;/SPAN&gt;, but you have specified &lt;SPAN style="color:hsl(0, 75%, 60%);"&gt;&lt;STRONG&gt;550&lt;/STRONG&gt;&lt;/SPAN&gt;, which I assume it is a typo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For this column the expression is: &lt;STRONG&gt;=&lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;If&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;IsNull&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;Above&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;TOTAL &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color:hsl(30, 75%, 60%);"&gt;&lt;STRONG&gt;Deletes&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;)), 0, &lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;Above&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;TOTAL &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color:hsl(30, 75%, 60%);"&gt;&lt;STRONG&gt;Adds&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;) - &lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;Above&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;TOTAL &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color:hsl(30, 75%, 60%);"&gt;&lt;STRONG&gt;Deletes&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;)) + &lt;/STRONG&gt;&lt;SPAN style="color:hsl(30, 75%, 60%);"&gt;&lt;STRONG&gt;Adds &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;- &lt;/STRONG&gt;&lt;SPAN style="color:hsl(30, 75%, 60%);"&gt;&lt;STRONG&gt;Deletes&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now for the final column, I can see that for the first record you have 0+100/2 which is (as you mentioned) &lt;SPAN style="color:hsl(270, 75%, 60%);"&gt;&lt;STRONG&gt;Previous Base + Current Base / 2&lt;/STRONG&gt;&lt;/SPAN&gt;. Therefore, 0 because previous base is Null. However for the second part, previous base is 100 and current base/2 is 350/2, so &amp;nbsp;175. So the outcome should be &lt;STRONG&gt;175 + 100 which is &lt;/STRONG&gt;&lt;SPAN style="color:hsl(120, 75%, 60%);"&gt;&lt;STRONG&gt;275&lt;/STRONG&gt;&lt;/SPAN&gt;, but you have specified &lt;SPAN style="color:hsl(0, 75%, 60%);"&gt;&lt;STRONG&gt;225&lt;/STRONG&gt;&lt;/SPAN&gt;. I assume that this is also a typo. The reason I am stating this, is because I have implemented the expressions based on the requirements, but the numbers doesn't match the representation that you gave. For the final column this is the expression that I have used: &lt;STRONG&gt;=&lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;If&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;IsNull&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;Above&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;TOTAL Column&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(1))), 0, &lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;Above&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;TOTAL Column&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(1))) + (&lt;/STRONG&gt;&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;Column&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(1) / 2)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The outcome is:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://lithium-response-prod.s3.us-west-2.amazonaws.com/qlik.response.lithium.com/RESPONSEIMAGE/b986e433-64ee-41d2-bcd1-c8d7a863a1a5.default.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color:hsl(0, 0%, 60%);"&gt;&lt;I&gt;&lt;STRONG&gt;I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, addressed your concerns or at least pointed you in the right direction, please mark it as Accepted Solution to give further visibility to other community members.&amp;nbsp;&lt;/STRONG&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 07:16:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952658#M78547</guid>
      <dc:creator>Andrei_Cusnir</dc:creator>
      <dc:date>2022-07-07T07:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Avg Base calculation</title>
      <link>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952731#M78553</link>
      <description>&lt;P&gt;Many Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/146877"&gt;@Andrei_Cusnir&lt;/a&gt;&amp;nbsp; for your time on this,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am almost sorted, but this Above&amp;nbsp; working in Straight table and I replace it with Before in Pivot it also working.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Only concern here when we select any particular Month its showing nulls (the reason could be our logic of Above or Before works fine when we have some rows Above or Before, Correct me here i am wrong)&lt;/P&gt;
&lt;P&gt;Is there any way using some variables in set expression where we can show 202201 = Base of 202112 + Adds -Delete. ??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks again.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 09:34:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1952731#M78553</guid>
      <dc:creator>dhasharadh</dc:creator>
      <dc:date>2022-07-07T09:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Avg Base calculation</title>
      <link>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1954396#M78713</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you are doing those calculations in real time, they are affected based on the selections that you make. However, as far as I understand, the calculated &lt;SPAN style="color:hsl(30, 75%, 60%);"&gt;&lt;STRONG&gt;Base &lt;/STRONG&gt;&lt;/SPAN&gt;and &lt;SPAN style="color:hsl(30, 75%, 60%);"&gt;&lt;STRONG&gt;Avg of Base&lt;/STRONG&gt;&lt;/SPAN&gt; is calculated for the specific date, so you wouldn't like it to change, based on the selection, but rather show the same number when you limit the rows on the view.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are 2 suggestions for this use case scenario:&lt;/P&gt;
&lt;P&gt;1. Either generate the values of &lt;SPAN style="color:hsl(30, 75%, 60%);"&gt;&lt;STRONG&gt;Base &lt;/STRONG&gt;&lt;/SPAN&gt;and&lt;SPAN style="color:hsl(30, 75%, 60%);"&gt;&lt;STRONG&gt; Avg of Base&lt;/STRONG&gt;&lt;/SPAN&gt; during reload in&lt;SPAN style="color:hsl(120, 75%, 60%);"&gt;&lt;STRONG&gt; Data load editor&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;(This will require some modifications and entirely different logic probably, as &lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;Above&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;() &lt;/STRONG&gt;and &lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;Before&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;()&lt;/STRONG&gt; functions, doesn't work in script)&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;2. Create a new state and apply this state to the&lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt; Table chart&lt;/STRONG&gt;&lt;/SPAN&gt; or &lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;Pivot Table chart&lt;/STRONG&gt;&lt;/SPAN&gt;, so the selections you make, won't affect the rows of the table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, if you would need further assistance with any of the above suggestions, I would recommend creating a new post, because the initial issue is already resolved: &lt;SPAN style="color:hsl(270, 75%, 60%);"&gt;&lt;STRONG&gt;"How to calculate the Base and Avg of Base"&lt;/STRONG&gt;&lt;/SPAN&gt;, now you have an issue with the &lt;SPAN style="color:hsl(210, 75%, 60%);"&gt;&lt;STRONG&gt;Null&lt;/STRONG&gt;&lt;/SPAN&gt;, which should be addressed in a different post, to avoid making the solution super complicated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color:hsl(0, 0%, 60%);"&gt;&lt;I&gt;&lt;STRONG&gt;I hope that this information helps.&lt;/STRONG&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 07:37:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Avg-Base-calculation/m-p/1954396#M78713</guid>
      <dc:creator>Andrei_Cusnir</dc:creator>
      <dc:date>2022-07-12T07:37:18Z</dc:date>
    </item>
  </channel>
</rss>

