<?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: Calculating the average and difference between two months in Load Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculating-the-average-and-difference-between-two-months-in/m-p/1215126#M389315</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try it with interrecord-functions within a sorted resident-load (to ensure the order of records is like your needs), maybe something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; YearMonth, Date, Average, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rangeavg(Average, previous(Average)) as AverageTwoMonth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Average - previous(Average) as DiffTwoMonth&lt;/P&gt;&lt;P&gt;resident YourSource order by Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Mar 2017 15:57:27 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2017-03-02T15:57:27Z</dc:date>
    <item>
      <title>Calculating the average and difference between two months in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-average-and-difference-between-two-months-in/m-p/1215125#M389314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am loading a very simple table in QlikView with a date and a specific Index, see screenshot below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="154994" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/154994_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I would like to calculate in the Load Scirpt the Average between two months, for example for moth 201602: (66,33+66,33)/2= 66,33 in Average and the difference between two months for example in month 201605 64-65=-1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know how to do it with Set Analysis in the Front End unfortunately it must be a calculation in the Script, so can anybody help me with this please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Mar 2017 10:19:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-average-and-difference-between-two-months-in/m-p/1215125#M389314</guid>
      <dc:creator>chriys1337</dc:creator>
      <dc:date>2017-03-02T10:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the average and difference between two months in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-average-and-difference-between-two-months-in/m-p/1215126#M389315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try it with interrecord-functions within a sorted resident-load (to ensure the order of records is like your needs), maybe something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; YearMonth, Date, Average, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rangeavg(Average, previous(Average)) as AverageTwoMonth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Average - previous(Average) as DiffTwoMonth&lt;/P&gt;&lt;P&gt;resident YourSource order by Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Mar 2017 15:57:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-average-and-difference-between-two-months-in/m-p/1215126#M389315</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-03-02T15:57:27Z</dc:date>
    </item>
  </channel>
</rss>

