<?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 Get Multiple Previous Years with Set Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Get-Multiple-Previous-Years-with-Set-Expression/m-p/420767#M156651</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 have a report with a simple List Chart that sums Net Value. I also have Calendar_Year as a field, so that multiple years can be selected. And I have this expression to calculate the previous selected year:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Calendar_Year={"$(=ONLY(Calendar_Year)-1)"}&amp;gt;} DocumentRows.LineTotal)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this won't work when multiple years are selected. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know a way to calculate the sum of the previous years when multiple years are selected?&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;Julian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Jan 2013 15:33:15 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-01-14T15:33:15Z</dc:date>
    <item>
      <title>Get Multiple Previous Years with Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Get-Multiple-Previous-Years-with-Set-Expression/m-p/420767#M156651</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 have a report with a simple List Chart that sums Net Value. I also have Calendar_Year as a field, so that multiple years can be selected. And I have this expression to calculate the previous selected year:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Calendar_Year={"$(=ONLY(Calendar_Year)-1)"}&amp;gt;} DocumentRows.LineTotal)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this won't work when multiple years are selected. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know a way to calculate the sum of the previous years when multiple years are selected?&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;Julian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 15:33:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-Multiple-Previous-Years-with-Set-Expression/m-p/420767#M156651</guid>
      <dc:creator />
      <dc:date>2013-01-14T15:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Get Multiple Previous Years with Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Get-Multiple-Previous-Years-with-Set-Expression/m-p/420768#M156652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Julian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;sum({$&amp;lt;Calendar_Year={"$(=max(Calendar_Year)-1)"}&amp;gt;} DocumentRows.LineTotal)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if you want the sum of all previous years try this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;sum({$&amp;lt;Calendar_Year={"&amp;lt;=$(=max(Calendar_Year)-1)&amp;gt;=$&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;(=min(Calendar_Year)-1)&lt;/SPAN&gt;"}&amp;gt;} DocumentRows.LineTotal)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 15:39:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-Multiple-Previous-Years-with-Set-Expression/m-p/420768#M156652</guid>
      <dc:creator />
      <dc:date>2013-01-14T15:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get Multiple Previous Years with Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Get-Multiple-Previous-Years-with-Set-Expression/m-p/420769#M156653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Gabriela!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I was looking for was your second anwer and it works like a charm!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 15:44:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-Multiple-Previous-Years-with-Set-Expression/m-p/420769#M156653</guid>
      <dc:creator />
      <dc:date>2013-01-14T15:44:03Z</dc:date>
    </item>
  </channel>
</rss>

