<?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 3 Months Average in Straight Table ? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179296#M895864</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Techies,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to find average of 3 months in a&amp;nbsp; straight table. Here Month_Yr is dimension. I have measure field day wise from source table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;For Month_Yr "Mar-2015", calculate average for values from 01-Jan-2015 to 31-Mar-2015.&lt;/P&gt;&lt;P&gt;For Month_Yr "Apr-2015", calculate average for values from 01-Feb-2015 to 30-Apr-2015 and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I have attached Test files for your reference. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>rajuamet</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>3 Months Average in Straight Table ?</title>
      <link>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179296#M895864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Techies,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to find average of 3 months in a&amp;nbsp; straight table. Here Month_Yr is dimension. I have measure field day wise from source table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;For Month_Yr "Mar-2015", calculate average for values from 01-Jan-2015 to 31-Mar-2015.&lt;/P&gt;&lt;P&gt;For Month_Yr "Apr-2015", calculate average for values from 01-Feb-2015 to 30-Apr-2015 and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I have attached Test files for your reference. &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/3-Months-Average-in-Straight-Table/m-p/1179296#M895864</guid>
      <dc:creator>rajuamet</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Months Average in Straight Table ?</title>
      <link>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179297#M895865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you need this in your load script of straight table?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jul 2016 06:50:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179297#M895865</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2016-07-30T06:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Months Average in Straight Table ?</title>
      <link>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179298#M895866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vineeth,&lt;/P&gt;&lt;P&gt;I need this in straight table without making changes in script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jul 2016 07:39:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179298#M895866</guid>
      <dc:creator>rajuamet</dc:creator>
      <dc:date>2016-07-30T07:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Months Average in Straight Table ?</title>
      <link>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179299#M895867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=RangeAvg( above(avg(Measure),0,3))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/133095_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jul 2016 07:45:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179299#M895867</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2016-07-30T07:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Months Average in Straight Table ?</title>
      <link>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179300#M895868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kushal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Month1 =&amp;gt; 10, 20, 30, 40&lt;/P&gt;&lt;P&gt;Month2 =&amp;gt; 50, 60, 70&lt;/P&gt;&lt;P&gt;Month3 =&amp;gt; 90, 10, 20, 30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your expression does this:&lt;/P&gt;&lt;P&gt;Month1=&amp;gt; (10+20+30+40)/4 =&amp;gt; (100/4) =&amp;gt; 25&lt;/P&gt;&lt;P&gt;Month2=&amp;gt; (50+60+70)/3 =&amp;gt; (180/3) =&amp;gt; 60&lt;/P&gt;&lt;P&gt;Month3=&amp;gt; (90+10+20+30)/4 =&amp;gt; (150/4) =&amp;gt; 37.5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then, (25+60+37.5)/3&amp;nbsp; =&amp;gt; (122.5/3) = 40.8333...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But actually it should take average for 3 months with day wise values. Therefore&amp;nbsp; it should do,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(10+20+30+40+50+60+70+90+10+20+30) / 11 = 39.0909...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here 39.0909 is the required result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I achieve this.........&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jul 2016 08:36:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179300#M895868</guid>
      <dc:creator>rajuamet</dc:creator>
      <dc:date>2016-07-30T08:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Months Average in Straight Table ?</title>
      <link>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179301#M895869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I done the logic as per your result needed excel file which is matching with your needed output&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jul 2016 09:14:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179301#M895869</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2016-07-30T09:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Months Average in Straight Table ?</title>
      <link>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179302#M895870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is the expected output you need for Mar - 2015?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jul 2016 09:22:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179302#M895870</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2016-07-30T09:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Months Average in Straight Table ?</title>
      <link>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179303#M895871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kushal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Required Result&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Result Needed.JPG" class="jive-image image-1" src="/legacyfs/online/133099_Result Needed.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result from your expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="pastedImage_0.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/133100_pastedImage_0.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Values after decimal point does not match... Because average has to be applied as per the above example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jul 2016 09:26:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179303#M895871</guid>
      <dc:creator>rajuamet</dc:creator>
      <dc:date>2016-07-30T09:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Months Average in Straight Table ?</title>
      <link>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179304#M895872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You want to show last months data while selection or Constant?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jul 2016 12:15:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179304#M895872</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2016-07-30T12:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Months Average in Straight Table ?</title>
      <link>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179305#M895873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sample:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Date,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;Floor(MonthEnd(Date)) - MonthStart(Date, -2) + 1 as Days,&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Measure,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(Date)&amp;amp;'-'&amp;amp;Year(Date) as Month_Yr&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Sample Data (1).xlsx]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(ooxml, embedded labels, table is Sheet1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where Days field will create a field which will help us know how many days do we need to go back for each month (which are not static). So months will have 91, 90, or 89 days&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/133106_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you get this under your belt, the next step is to use the following formula, but this will only work in QV12 (because sorting in Aggr is only available in QV12 or Qlik Sense &lt;A href="https://community.qlik.com/qlik-blogpost/4673"&gt;The sortable Aggr function is finally here!&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Aggr(If(Date = Floor(MonthEnd(Date)), RangeAvg(Above(Avg(Measure), 0, Days))), &lt;SPAN style="color: #ff0000;"&gt;(&lt;/SPAN&gt;Date&lt;SPAN style="color: #ff0000;"&gt;, (NUMERIC))&lt;/SPAN&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't have QV12, you will need to sort the date in the script, which might be difficult if you can bring your master calendar before anything else. If you can do this, then you can use this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Aggr(If(Date = Floor(MonthEnd(Date)), RangeAvg(Above(Avg(Measure), 0, Days))), Date)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/133107_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regular expression works here because your data was well sorted in the Excel file, which might not be true for your real data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jul 2016 13:27:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179305#M895873</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-07-30T13:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Months Average in Straight Table ?</title>
      <link>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179306#M895874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should be constant.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Jul 2016 08:14:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179306#M895874</guid>
      <dc:creator>rajuamet</dc:creator>
      <dc:date>2016-07-31T08:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Months Average in Straight Table ?</title>
      <link>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179307#M895875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome Sunny! This is what I want. Thanks &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Jul 2016 08:15:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179307#M895875</guid>
      <dc:creator>rajuamet</dc:creator>
      <dc:date>2016-07-31T08:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Months Average in Straight Table ?</title>
      <link>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179308#M895876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Jul 2016 08:18:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179308#M895876</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-07-31T08:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Months Average in Straight Table ?</title>
      <link>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179309#M895877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Without making changes to your load script you can use expression as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rangesum(above(sum(Measure),0,3))&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;rangesum(above(Count(DateIS),0,3))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Jul 2016 08:54:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179309#M895877</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2016-07-31T08:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: 3 Months Average in Straight Table ?</title>
      <link>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179310#M895878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Extraordinary Vineeth &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/cool.png" /&gt;... Perfect...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Jul 2016 10:14:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/3-Months-Average-in-Straight-Table/m-p/1179310#M895878</guid>
      <dc:creator>rajuamet</dc:creator>
      <dc:date>2016-07-31T10:14:13Z</dc:date>
    </item>
  </channel>
</rss>

