<?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 Making calculations based on data from n previous years in a table where each row identifies a year in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Making-calculations-based-on-data-from-n-previous-years-in-a/m-p/2091553#M89475</link>
    <description>&lt;P&gt;I am building a table where I have four columns: Year; allocated resources; total grants; ratio of grants to resources. It is like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Immagine 2023-07-07 145211.png" style="width: 446px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/111772i6A10F17B56E5B24C/image-dimensions/446x107?v=v2" width="446" height="107" role="button" title="Immagine 2023-07-07 145211.png" alt="Immagine 2023-07-07 145211.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, i need to add a fifth column, which will be a benchmark where I must calculate the average value of the grants to resources ratio for the three previous years.&amp;nbsp;Is this possible? And if so, how can I accomplish this?&lt;/P&gt;
&lt;P&gt;I am trying to do that using set analysis, but currently I can't even figure out how to get the value from just the previous year. If I try something like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{$&amp;lt;Year={"&amp;gt;=$(Year-1) &amp;lt;=$(Year-1)"}&amp;gt;}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I only get in each row data from that same year. If I try to apply the MAX function to the year field, I obviusly only get data for the Year thus selected. If I just check for equality, instead of checking for both greater than and smaller than, I get 0.&lt;/P&gt;
&lt;P&gt;I am completely stuck and can't figure out how to solve this problem.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jul 2023 13:09:20 GMT</pubDate>
    <dc:creator>Valnar</dc:creator>
    <dc:date>2023-07-07T13:09:20Z</dc:date>
    <item>
      <title>Making calculations based on data from n previous years in a table where each row identifies a year</title>
      <link>https://community.qlik.com/t5/App-Development/Making-calculations-based-on-data-from-n-previous-years-in-a/m-p/2091553#M89475</link>
      <description>&lt;P&gt;I am building a table where I have four columns: Year; allocated resources; total grants; ratio of grants to resources. It is like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Immagine 2023-07-07 145211.png" style="width: 446px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/111772i6A10F17B56E5B24C/image-dimensions/446x107?v=v2" width="446" height="107" role="button" title="Immagine 2023-07-07 145211.png" alt="Immagine 2023-07-07 145211.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, i need to add a fifth column, which will be a benchmark where I must calculate the average value of the grants to resources ratio for the three previous years.&amp;nbsp;Is this possible? And if so, how can I accomplish this?&lt;/P&gt;
&lt;P&gt;I am trying to do that using set analysis, but currently I can't even figure out how to get the value from just the previous year. If I try something like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{$&amp;lt;Year={"&amp;gt;=$(Year-1) &amp;lt;=$(Year-1)"}&amp;gt;}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I only get in each row data from that same year. If I try to apply the MAX function to the year field, I obviusly only get data for the Year thus selected. If I just check for equality, instead of checking for both greater than and smaller than, I get 0.&lt;/P&gt;
&lt;P&gt;I am completely stuck and can't figure out how to solve this problem.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 13:09:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Making-calculations-based-on-data-from-n-previous-years-in-a/m-p/2091553#M89475</guid>
      <dc:creator>Valnar</dc:creator>
      <dc:date>2023-07-07T13:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Making calculations based on data from n previous years in a table where each row identifies a year</title>
      <link>https://community.qlik.com/t5/App-Development/Making-calculations-based-on-data-from-n-previous-years-in-a/m-p/2091582#M89476</link>
      <description>&lt;P&gt;I managed to solve my problem applying the AsOf solution from this article:&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Member-Articles/Calculating-rolling-n-period-totals-averages-or-other/ta-p/1483033" target="_blank"&gt;https://community.qlik.com/t5/Member-Articles/Calculating-rolling-n-period-totals-averages-or-other/ta-p/1483033&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 14:16:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Making-calculations-based-on-data-from-n-previous-years-in-a/m-p/2091582#M89476</guid>
      <dc:creator>Valnar</dc:creator>
      <dc:date>2023-07-07T14:16:18Z</dc:date>
    </item>
  </channel>
</rss>

