<?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: Using set analysis to return last year's value by month in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-to-return-last-year-s-value-by-month/m-p/1364591#M417816</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this?&lt;/P&gt;&lt;P&gt;Dimension is &lt;STRONG&gt;Year&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Current - &lt;STRONG&gt;Sum({&amp;lt;Year -= {'$(=Min(Year))'}&amp;gt;}Value)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Previous - &lt;STRONG&gt;Above(Sum(Value),1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/163827_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 May 2017 01:22:39 GMT</pubDate>
    <dc:creator>Anil_Babu_Samineni</dc:creator>
    <dc:date>2017-05-18T01:22:39Z</dc:date>
    <item>
      <title>Using set analysis to return last year's value by month</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-to-return-last-year-s-value-by-month/m-p/1364589#M417814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got a situation where I want to return the value of the previous year in a chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is easy enough using above() function. However, I don't want to display the first year on my chart, so my selection is limited to 2015 onwards. The above() cannot refer to values that are not in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example of my input and desired output. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="previous using set analysis.PNG" class="jive-image image-1" src="/legacyfs/online/163821_previous using set analysis.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking of using a set analysis to accomplish this, something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;lt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year = {"Year - 1"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this doesn't work. I parameterised my year deduction and tried to insert it within $():&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variable: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expYearMinusOne = '$1-1'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in the chart: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =$(expYearMinusOne(Cal_Year))&amp;nbsp;&amp;nbsp;&amp;nbsp; returns the year minus one as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, this doesn't work within a set analysis, e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;lt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt;"&gt;Year = {'$(expYearMinusOne(Year))'}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Will&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 23:35:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-to-return-last-year-s-value-by-month/m-p/1364589#M417814</guid>
      <dc:creator>william_ericksson</dc:creator>
      <dc:date>2017-05-17T23:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using set analysis to return last year's value by month</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-to-return-last-year-s-value-by-month/m-p/1364590#M417815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I should add that my final set analysis syntax was actually:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sum(&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;lt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Year = {"=$(expYearMinusOne(Year))"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;}&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; Value)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 23:42:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-to-return-last-year-s-value-by-month/m-p/1364590#M417815</guid>
      <dc:creator>william_ericksson</dc:creator>
      <dc:date>2017-05-17T23:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using set analysis to return last year's value by month</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-to-return-last-year-s-value-by-month/m-p/1364591#M417816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this?&lt;/P&gt;&lt;P&gt;Dimension is &lt;STRONG&gt;Year&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Current - &lt;STRONG&gt;Sum({&amp;lt;Year -= {'$(=Min(Year))'}&amp;gt;}Value)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Previous - &lt;STRONG&gt;Above(Sum(Value),1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/163827_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 May 2017 01:22:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-to-return-last-year-s-value-by-month/m-p/1364591#M417816</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-05-18T01:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using set analysis to return last year's value by month</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-to-return-last-year-s-value-by-month/m-p/1364592#M417817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Anil -your solution works well! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in summary - rather than INCLUDE the years I want to see using set analysis, the solution is to EXCLUDE the years not wanted using -=&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brilliant!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 May 2017 01:57:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-to-return-last-year-s-value-by-month/m-p/1364592#M417817</guid>
      <dc:creator>william_ericksson</dc:creator>
      <dc:date>2017-05-18T01:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using set analysis to return last year's value by month</title>
      <link>https://community.qlik.com/t5/QlikView/Using-set-analysis-to-return-last-year-s-value-by-month/m-p/1364593#M417818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome!! I wonder, you found something &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 May 2017 02:00:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-set-analysis-to-return-last-year-s-value-by-month/m-p/1364593#M417818</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-05-18T02:00:15Z</dc:date>
    </item>
  </channel>
</rss>

