<?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 Last 30 day average in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Last-30-day-average/m-p/1103357#M365658</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 create a pivot in like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; border-image: none; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Count(Activity)&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Last 30 day average&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;29-Aug-2016&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Count(Activity) on 29th Aug&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Count(Activity) for last 30 days/30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;28-Aug-2016&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Count(Activity) on 28th Aug&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Count(Activity) for last 30 days/30&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp; so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am unable to get last 30 day average right. The problem is due to Date being used as dimension.&lt;/P&gt;&lt;P&gt;If I make a calendar object &amp;amp; select a date &amp;amp; use any other dimension, the calculation turns out to be right.&lt;/P&gt;&lt;P&gt;Can someone help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Neha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Aug 2016 09:10:12 GMT</pubDate>
    <dc:creator>nesawant</dc:creator>
    <dc:date>2016-08-29T09:10:12Z</dc:date>
    <item>
      <title>Last 30 day average</title>
      <link>https://community.qlik.com/t5/QlikView/Last-30-day-average/m-p/1103357#M365658</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 create a pivot in like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; border-image: none; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Count(Activity)&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Last 30 day average&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;29-Aug-2016&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Count(Activity) on 29th Aug&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Count(Activity) for last 30 days/30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;28-Aug-2016&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Count(Activity) on 28th Aug&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Count(Activity) for last 30 days/30&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp; so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am unable to get last 30 day average right. The problem is due to Date being used as dimension.&lt;/P&gt;&lt;P&gt;If I make a calendar object &amp;amp; select a date &amp;amp; use any other dimension, the calculation turns out to be right.&lt;/P&gt;&lt;P&gt;Can someone help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Neha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 09:10:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-30-day-average/m-p/1103357#M365658</guid>
      <dc:creator>nesawant</dc:creator>
      <dc:date>2016-08-29T09:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Last 30 day average</title>
      <link>https://community.qlik.com/t5/QlikView/Last-30-day-average/m-p/1103358#M365659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use Above/Below functions with RangeAvg().&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-8242"&gt;Missing Manual - Above() and Below()&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or Before/After if the Dates are pivoted&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-8205"&gt;Missing Manual - Before() and After()&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 12:29:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-30-day-average/m-p/1103358#M365659</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-08-29T12:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Last 30 day average</title>
      <link>https://community.qlik.com/t5/QlikView/Last-30-day-average/m-p/1103359#M365660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Neha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are basically 2 ways:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. pls add an indicator in your Calender/fact table each of the last 30 days. like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(today() - Fact-Date &amp;gt; 30, 0,1) as 30DayAvg_Ind&lt;/STRONG&gt; now you marked your records which are valid for the AVG calculartion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now you can calculate the proper average with a formula somewhat like:&lt;/P&gt;&lt;P&gt;=AVG(${ &amp;lt;30DayAvg_Ind={'1'} &amp;gt;} Counter), this wil do the trick in a formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&lt;/P&gt;&lt;P&gt;Calculate the averages of all your dimensions in the script with the &lt;STRONG&gt;group by&lt;/STRONG&gt; statement:&lt;/P&gt;&lt;P&gt;and add these averages to your facts with join or applymap...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;30DayAVG: &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;NoConcatenate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;resident Facts&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Key,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;avg(Counter) as Average_Dim1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;where &lt;STRONG&gt;30DayAvg_Ind&lt;/STRONG&gt; group by dimension1; (this should be done for every dimension)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;and add these averages to all the facts records with a left join or applymap&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Than you are able to display the created average field (Average_Dim1)from your datamodel into your table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;good luck and HTH&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;P.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 12:52:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-30-day-average/m-p/1103359#M365660</guid>
      <dc:creator />
      <dc:date>2016-08-29T12:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Last 30 day average</title>
      <link>https://community.qlik.com/t5/QlikView/Last-30-day-average/m-p/1103360#M365661</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;This pivot is not being calculated for all dates. I have a calendar object which is used to select a date &amp;amp; the pivot needs to be calculated only for that date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2016 14:10:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-30-day-average/m-p/1103360#M365661</guid>
      <dc:creator>nesawant</dc:creator>
      <dc:date>2016-08-30T14:10:06Z</dc:date>
    </item>
  </channel>
</rss>

