<?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: Previous year set analysis where year is a dimension in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Previous-year-set-analysis-where-year-is-a-dimension/m-p/619949#M548603</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are looking for inter-record-functions like above(), below(), ... like this: = above(sum( [Share Class NAV])).&lt;/P&gt;&lt;P&gt;If you have year as dimension within the table you don't needed set analysis for year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Feb 2014 12:20:10 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2014-02-07T12:20:10Z</dc:date>
    <item>
      <title>Previous year set analysis where year is a dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-year-set-analysis-where-year-is-a-dimension/m-p/619948#M548602</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;Thanks very much for looking at my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to do a set analysis expression to compare the annual total (dimension = year) with the annual total for the previous year.&amp;nbsp; NB my actual end-goal is much more complicated than this, but to troubleshoot I've simplified things as far as I can.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't get the set analysis for "previous year" to work. I've tried a few things, including TOTAL, different syntax for the modifier, putting PreviousYear field into script etc etc - see different tables in attached QVW.&amp;nbsp; I can get it to work as expected when I "hard code" the modifier, e.g. Year={"2012"} - but obviously I need the year to be dynamically the previous year, not fixed as 2012.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated, thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sarah&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NB here is my initial attempt (doesn't work - gives zero), and also the "hard coded" 2012 example (which works as expected).&amp;nbsp; A few other attempts can be seen in the QVW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Initial attempt&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;=&lt;/TD&gt;&lt;TD&gt;sum(&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;{$&amp;lt;&amp;nbsp; Year={$(=only(Year)-1)}&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;}&lt;/P&gt;&lt;P&gt;total &amp;lt;[Share Class]&amp;gt;&lt;/P&gt;&lt;P&gt; [Share Class NAV]) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Hard coded 2012 example&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;=&lt;/TD&gt;&lt;TD&gt;sum(&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;{$&amp;lt;&amp;nbsp; Year={"2012"}&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;}&lt;/P&gt;&lt;P&gt;total &amp;lt;[Share Class]&amp;gt;&lt;/P&gt;&lt;P&gt; [Share Class NAV]) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;NB the expected result would be this:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 820px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl67" height="36" width="52"&gt;Share Class&lt;/TD&gt;&lt;TD class="xl71" colspan="2" style="border-right: .5pt solid gainsboro; border-left: none;" width="192"&gt;Income A&lt;/TD&gt;&lt;TD class="xl71" colspan="2" style="border-right: .5pt solid gainsboro; border-left: none;" width="192"&gt;Income B&lt;/TD&gt;&lt;TD class="xl71" colspan="2" style="border-right: .5pt solid gainsboro; border-left: none;" width="192"&gt;Income X Acc&lt;/TD&gt;&lt;TD class="xl71" colspan="2" style="border-right: .5pt solid gainsboro; border-left: none;" width="192"&gt;Income X Inc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl70" height="90" width="52"&gt;Year&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none;" width="95"&gt;"Annual total NAV" (example expression)&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="97"&gt;"PREVIOUS Annual total NAV" (example expression)&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="95"&gt;"Annual total NAV" (example expression)&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="97"&gt;"PREVIOUS Annual total NAV" (example expression)&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="95"&gt;"Annual total NAV" (example expression)&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="97"&gt;"PREVIOUS Annual total NAV" (example expression)&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="95"&gt;"Annual total NAV" (example expression)&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="97"&gt;"PREVIOUS Annual total NAV" (example expression)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="18" style="border-top: none;"&gt;2011&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="18" style="border-top: none;"&gt;2012&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;1,303,925&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;71,231,525&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;100,057&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;6,023,394&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="18" style="border-top: none;"&gt;2013&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;494,645,496&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;1,303,925&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;108,991,447&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;71,231,525&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;65,211,097&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;100,057&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;420,197,495&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;6,023,394&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="18" style="border-top: none;"&gt;2014&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;1,293,868,935&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;494,645,496&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;32,736,634&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;108,991,447&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;306,152,356&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;65,211,097&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;1,545,748,172&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;420,197,495&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="18" style="border-top: none;"&gt;2015&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;646,934,468&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;1,293,868,935&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;16,368,317&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;32,736,634&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;153,076,178&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;306,152,356&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;772,874,086&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;1,545,748,172&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 11:01:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-year-set-analysis-where-year-is-a-dimension/m-p/619948#M548602</guid>
      <dc:creator>sarahallen1</dc:creator>
      <dc:date>2014-02-07T11:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: Previous year set analysis where year is a dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-year-set-analysis-where-year-is-a-dimension/m-p/619949#M548603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are looking for inter-record-functions like above(), below(), ... like this: = above(sum( [Share Class NAV])).&lt;/P&gt;&lt;P&gt;If you have year as dimension within the table you don't needed set analysis for year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 12:20:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-year-set-analysis-where-year-is-a-dimension/m-p/619949#M548603</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2014-02-07T12:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Previous year set analysis where year is a dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-year-set-analysis-where-year-is-a-dimension/m-p/619950#M548604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excellent - thank you very much Marcus.&amp;nbsp; The above() function works - I didn't know about that function, will definitely come in use.&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 12:23:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-year-set-analysis-where-year-is-a-dimension/m-p/619950#M548604</guid>
      <dc:creator>sarahallen1</dc:creator>
      <dc:date>2014-02-07T12:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Previous year set analysis where year is a dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-year-set-analysis-where-year-is-a-dimension/m-p/619951#M548606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this question is being answered in previous thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where you have make that thread ok&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fyi.. add =sum(YourField) in first expression and&amp;nbsp; =above() in second expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 12:26:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-year-set-analysis-where-year-is-a-dimension/m-p/619951#M548606</guid>
      <dc:creator>ashwanin</dc:creator>
      <dc:date>2014-02-07T12:26:35Z</dc:date>
    </item>
  </channel>
</rss>

