<?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 previous year value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Get-previous-year-value/m-p/194139#M55146</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John, great thanks for answer. Really, you're rigth - I had tried to use set analysis in wrong way. Unfortunately, I haven't enough time to study QV in details, and I have to get expirience at real tasks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Dec 2009 16:12:33 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-12-22T16:12:33Z</dc:date>
    <item>
      <title>Get previous year value</title>
      <link>https://community.qlik.com/t5/QlikView/Get-previous-year-value/m-p/194134#M55141</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;apparently I use wrong syntax -&lt;/P&gt;&lt;P&gt;there's some aggregation "avg(Price)", I need to get this value for previous year and I try to use this expression -&lt;/P&gt;&lt;P&gt;"avg({&amp;lt;Year = $(Year - 1)&amp;gt;} Price)" and result is null ... what's wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2009 22:43:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-previous-year-value/m-p/194134#M55141</guid>
      <dc:creator />
      <dc:date>2009-12-21T22:43:03Z</dc:date>
    </item>
    <item>
      <title>Get previous year value</title>
      <link>https://community.qlik.com/t5/QlikView/Get-previous-year-value/m-p/194135#M55142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;avg({&amp;lt;Year={$(#=Only(Year)-1)} Price)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Maya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2009 22:59:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-previous-year-value/m-p/194135#M55142</guid>
      <dc:creator />
      <dc:date>2009-12-21T22:59:03Z</dc:date>
    </item>
    <item>
      <title>Get previous year value</title>
      <link>https://community.qlik.com/t5/QlikView/Get-previous-year-value/m-p/194136#M55143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Maya&lt;/P&gt;&lt;P&gt;I remake you code to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;=avg( { &amp;lt; Year = { $(#=Only(Year)-1) } &amp;gt; } Price )&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;but it's not working, unfortunately.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2009 23:16:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-previous-year-value/m-p/194136#M55143</guid>
      <dc:creator />
      <dc:date>2009-12-21T23:16:19Z</dc:date>
    </item>
    <item>
      <title>Get previous year value</title>
      <link>https://community.qlik.com/t5/QlikView/Get-previous-year-value/m-p/194137#M55144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect you have a deeper problem than syntax (the syntax looks good to me). Are you trying to create a chart like this?&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Year Average Price Previous Year's Average Price&lt;BR /&gt;2009 50 40&lt;BR /&gt;2008 40 45&lt;BR /&gt;2007 45 30&lt;/P&gt;&lt;P&gt;If so, then the fundamental limitation is that a set is only built once for the entire chart, not once per row. So the only(Year) portion will actually return null since there are three years for the whole table. It will not return the year for the specific row of the table. I don't believe you can use set analysis alone to build this chart.&lt;/P&gt;&lt;P&gt;Attached is one way of handling a chart like the above. There are certainly other ways. It all depends on the specifics of the situation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2009 08:37:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-previous-year-value/m-p/194137#M55144</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-12-22T08:37:41Z</dc:date>
    </item>
    <item>
      <title>Get previous year value</title>
      <link>https://community.qlik.com/t5/QlikView/Get-previous-year-value/m-p/194138#M55145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dmitry,&lt;/P&gt;&lt;P&gt;Here is another possible solution. You can use an expression similar to what you wrote to create a column in a table for prior period average. In order to do that, you should select the current year from a select list. This solution will always give you the current and prior year values and can be used to creat columns for any number of years in the past. Here are the two columns I use for current and prior:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the current year use this expression - avg({$&amp;lt;FinYear={$(=Only(FinYear))}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the prior year use this expression - avg({$&amp;lt;FinYear={$(=Only(FinYear)-1)}&amp;gt;}Sales)&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached the solution.&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2009 10:23:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-previous-year-value/m-p/194138#M55145</guid>
      <dc:creator />
      <dc:date>2009-12-22T10:23:03Z</dc:date>
    </item>
    <item>
      <title>Get previous year value</title>
      <link>https://community.qlik.com/t5/QlikView/Get-previous-year-value/m-p/194139#M55146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John, great thanks for answer. Really, you're rigth - I had tried to use set analysis in wrong way. Unfortunately, I haven't enough time to study QV in details, and I have to get expirience at real tasks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2009 16:12:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-previous-year-value/m-p/194139#M55146</guid>
      <dc:creator />
      <dc:date>2009-12-22T16:12:33Z</dc:date>
    </item>
  </channel>
</rss>

