<?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 Set analysis question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-question/m-p/961499#M960195</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a profit / loss statement. I am trying to compare same period last year.&lt;/P&gt;&lt;P&gt;To make this work, I use this expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({1&amp;lt;Year={'=$(vLastYear)'},Period={'=$(vPeriod)'}&amp;gt;}Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vLastYear and vPeriod gets the value based on selection made by the user. If user sets year = 2014 the value is 2013. To accomplish this I use the expression =(GetFieldSelections(Year)-1). The listbox is set to only one&amp;nbsp; possible value selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem that I am having is that regardless what year I select, it is showing the result for the selected year, not the previous year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change the variable $(vLastYear) with the actual year (f.example 2013), the result is correct.&lt;/P&gt;&lt;P&gt;I have also tried to change the {1&amp;lt; in the set expression to {$&amp;lt;, but this seems not the change anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have checked the value for vLastYear, and it is giving me the correct result (in other words if I choose 2014, the value is 2013).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope someone can help me in the right direction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Oct 2015 12:26:24 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-10-26T12:26:24Z</dc:date>
    <item>
      <title>Set analysis question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-question/m-p/961499#M960195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a profit / loss statement. I am trying to compare same period last year.&lt;/P&gt;&lt;P&gt;To make this work, I use this expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({1&amp;lt;Year={'=$(vLastYear)'},Period={'=$(vPeriod)'}&amp;gt;}Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vLastYear and vPeriod gets the value based on selection made by the user. If user sets year = 2014 the value is 2013. To accomplish this I use the expression =(GetFieldSelections(Year)-1). The listbox is set to only one&amp;nbsp; possible value selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem that I am having is that regardless what year I select, it is showing the result for the selected year, not the previous year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change the variable $(vLastYear) with the actual year (f.example 2013), the result is correct.&lt;/P&gt;&lt;P&gt;I have also tried to change the {1&amp;lt; in the set expression to {$&amp;lt;, but this seems not the change anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have checked the value for vLastYear, and it is giving me the correct result (in other words if I choose 2014, the value is 2013).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope someone can help me in the right direction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2015 12:26:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-question/m-p/961499#M960195</guid>
      <dc:creator />
      <dc:date>2015-10-26T12:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis question</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-question/m-p/961500#M960196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Found the answer myself &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/laugh.png" /&gt; &lt;/P&gt;&lt;P&gt;This worked:&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Year={$(#vLastYear)}&amp;gt;}Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope someone also can use this sollution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2015 13:50:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-question/m-p/961500#M960196</guid>
      <dc:creator />
      <dc:date>2015-10-26T13:50:23Z</dc:date>
    </item>
  </channel>
</rss>

