<?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 Trying to calculate yr by yr variances in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Trying-to-calculate-yr-by-yr-variances/m-p/1400996#M812136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new to qlikview, creating some simple dashboards, I am trying to calculate yr by yr variances in a pivot style table, ex. =Sum({&amp;lt;Yearnum&amp;gt;} Sales) - Sum({&amp;lt;Yearnum-1&amp;gt;} Sales).&amp;nbsp; Breaking this down, Sum (Sales) is my base line. Sum({&amp;lt;Yearnum&amp;gt;} Sales) returns same values as Sum (Sales). Testing Yearnum-1 returns expected year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The full expression returns empty field. Any thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Trying to calculate yr by yr variances</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-calculate-yr-by-yr-variances/m-p/1400996#M812136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new to qlikview, creating some simple dashboards, I am trying to calculate yr by yr variances in a pivot style table, ex. =Sum({&amp;lt;Yearnum&amp;gt;} Sales) - Sum({&amp;lt;Yearnum-1&amp;gt;} Sales).&amp;nbsp; Breaking this down, Sum (Sales) is my base line. Sum({&amp;lt;Yearnum&amp;gt;} Sales) returns same values as Sum (Sales). Testing Yearnum-1 returns expected year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The full expression returns empty field. Any thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-calculate-yr-by-yr-variances/m-p/1400996#M812136</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate yr by yr variances</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-calculate-yr-by-yr-variances/m-p/1400997#M812137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Norman,&lt;/P&gt;&lt;P&gt;If Year is your year field then try these expressions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Total for 2017: Sum({$&amp;lt;&lt;SPAN style="font-size: 13.3333px;"&gt;Year = {2017} &lt;/SPAN&gt;&amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Total for 2016: Sum({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Year = {2016} &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Substitute your Yearnum field and corresponding values if required.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;You can also try&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Total for selected year: Sum({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Year = {$(=max(Year))} &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Total for previous year: Sum({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Year = {$(=-1+max(Year))} &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Again substitute &lt;SPAN style="font-size: 13.3333px;"&gt;Yearnum field and corresponding values if required.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Good luck&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Andrew&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Sep 2017 09:13:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-calculate-yr-by-yr-variances/m-p/1400997#M812137</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2017-09-23T09:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate yr by yr variances</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-calculate-yr-by-yr-variances/m-p/1400998#M812138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Goal &lt;A _jive_internal="true" href="https://community.qlik.com/thread/275632?sr=inbox&amp;amp;ru=152494"&gt;&lt;SPAN style="color: #0066cc; text-decoration: underline;"&gt;Trying to calculate yr by yr variances&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx for feedback on original question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Made some adjustments based on feedback and some qlikview videos&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Year = {"2010"} &amp;gt;}Sales) - Expression works as is, but only one year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Year = {$(=max(Year))} &amp;gt;}Sales) - Expression works as is, but only max year of data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Year = {$(=-1+max(Year))} &amp;gt;}Sales) - Expression works as is, but only previous of max year of data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Year = {$(=(Year)-1)} &amp;gt;}Sales) -&amp;nbsp; Expression DOES NOT work????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Year = {$(=-1+max(Year))} &amp;gt;}Sales) - This will populate equivalent of Sum(Sales) for previous year of full years 2012 -2009. Keeping in mind original ask is variance for each year so (2009 assume blank), (2010-2009), (2011-2010), (2012-2011)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 1037px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="18" style="border: 1px solid #dcdcdc; background-color: #f5f5f5;" width="102"&gt;&lt;STRONG style="color: #333333; font-family: Tahoma;"&gt;Year&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 1px 1px 1px 0px; border-style: solid solid solid none; border-color: #dcdcdc #dcdcdc #dcdcdc #333333;" width="63"&gt;&lt;SPAN style="color: #333333; font-family: Tahoma;"&gt;2009&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 1px 1px 1px 0px; border-style: solid solid solid none; border-color: #dcdcdc #dcdcdc #dcdcdc #333333;" width="161"&gt;&lt;SPAN style="color: #333333; font-family: Tahoma;"&gt;2009&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 1px 1px 1px 0px; border-style: solid solid solid none; border-color: #dcdcdc #dcdcdc #dcdcdc #333333;" width="76"&gt;&lt;SPAN style="color: #333333; font-family: Tahoma;"&gt;2010&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 1px 1px 1px 0px; border-style: solid solid solid none; border-color: #dcdcdc #dcdcdc #dcdcdc #333333;" width="161"&gt;&lt;SPAN style="color: #333333; font-family: Tahoma;"&gt;2010&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 1px 1px 1px 0px; border-style: solid solid solid none; border-color: #dcdcdc #dcdcdc #dcdcdc #333333;" width="76"&gt;&lt;SPAN style="color: #333333; font-family: Tahoma;"&gt;2011&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 1px 1px 1px 0px; border-style: solid solid solid none; border-color: #dcdcdc #dcdcdc #dcdcdc #333333;" width="161"&gt;&lt;SPAN style="color: #333333; font-family: Tahoma;"&gt;2011&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 1px 1px 1px 0px; border-style: solid solid solid none; border-color: #dcdcdc #dcdcdc #dcdcdc #333333;" width="76"&gt;&lt;SPAN style="color: #333333; font-family: Tahoma;"&gt;2012&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 1px 1px 1px 0px; border-style: solid solid solid none; border-color: #dcdcdc #dcdcdc #dcdcdc #333333;" width="161"&gt;&lt;SPAN style="color: #333333; font-family: Tahoma;"&gt;2012&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="18" style="border: 1px solid #dcdcdc; background-color: #f5f5f5;"&gt;&lt;STRONG style="color: #333333; font-family: Tahoma;"&gt;CategoryName&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style="border-width: 0px 1px 1px; border-style: none solid solid; border-color: #333333 #dcdcdc #dcdcdc;"&gt;&lt;SPAN style="color: #333333; font-family: Tahoma;"&gt;Sum (Sales)&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border-width: 0px 1px 1px 0px; border-style: none solid solid none; border-color: #333333 #dcdcdc #dcdcdc #333333;"&gt;&lt;SPAN style="color: #333333; font-family: Tahoma;"&gt;Sum({$&amp;lt;Year = {2011} &amp;gt;}Sales)&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border-width: 0px 1px 1px 0px; border-style: none solid solid none; border-color: #333333 #dcdcdc #dcdcdc #333333;"&gt;&lt;SPAN style="color: #333333; font-family: Tahoma;"&gt;Sum (Sales)&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border-width: 0px 1px 1px 0px; border-style: none solid solid none; border-color: #333333 #dcdcdc #dcdcdc #333333;"&gt;&lt;SPAN style="color: #333333; font-family: Tahoma;"&gt;Sum({$&amp;lt;Year = {2011} &amp;gt;}Sales)&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border-width: 0px 1px 1px 0px; border-style: none solid solid none; border-color: #333333 #dcdcdc #dcdcdc #333333;"&gt;&lt;SPAN style="color: #333333; font-family: Tahoma;"&gt;Sum (Sales)&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border-width: 0px 1px 1px 0px; border-style: none solid solid none; border-color: #333333 #dcdcdc #dcdcdc #333333;"&gt;&lt;SPAN style="color: #333333; font-family: Tahoma;"&gt;&lt;STRONG&gt;Sum({$&amp;lt;Year = {2011} &amp;gt;}Sales)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border-width: 0px 1px 1px 0px; border-style: none solid solid none; border-color: #333333 #dcdcdc #dcdcdc #333333;"&gt;&lt;SPAN style="color: #333333; font-family: Tahoma;"&gt;Sum (Sales)&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border-width: 0px 1px 1px 0px; border-style: none solid solid none; border-color: #333333 #dcdcdc #dcdcdc #333333;"&gt;&lt;SPAN style="color: #333333; font-family: Tahoma;"&gt;Sum({$&amp;lt;Year = {2011} &amp;gt;}Sales)&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="18" style="border-width: 0px 1px 1px; border-style: none solid solid; border-color: #000000 #dcdcdc #dcdcdc; background-color: #f5f5f5;"&gt;&lt;SPAN style="font-family: Tahoma;"&gt;Total&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 1px 1px 0px; border-style: none solid solid none; border-color: #000000 #dcdcdc #dcdcdc #000000; background-color: #f5f5f5;"&gt;&lt;SPAN style="font-family: Tahoma;"&gt;87666.294&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 1px 1px 0px; border-style: none solid solid none; border-color: #000000 #dcdcdc #dcdcdc #000000; background-color: #f5f5f5;"&gt;&lt;SPAN style="font-family: Tahoma;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 1px 1px 0px; border-style: none solid solid none; border-color: #000000 #dcdcdc #dcdcdc #000000; background-color: #f5f5f5;"&gt;&lt;SPAN style="font-family: Tahoma;"&gt;371204.7161&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 1px 1px 0px; border-style: none solid solid none; border-color: #000000 #dcdcdc #dcdcdc #000000; background-color: #f5f5f5;"&gt;&lt;SPAN style="font-family: Tahoma;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 1px 1px 0px; border-style: none solid solid none; border-color: #000000 #dcdcdc #dcdcdc #000000; background-color: #f5f5f5;"&gt;&lt;SPAN style="font-family: Tahoma;"&gt;642508.7716&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 1px 1px 0px; border-style: none solid solid none; border-color: #000000 #dcdcdc #dcdcdc #000000; background-color: #f5f5f5;"&gt;&lt;SPAN style="font-family: Tahoma;"&gt;&lt;STRONG&gt;642508.7716&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 1px 1px 0px; border-style: none solid solid none; border-color: #000000 #dcdcdc #dcdcdc #000000; background-color: #f5f5f5;"&gt;&lt;SPAN style="font-family: Tahoma;"&gt;683656.4034&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 1px 1px 0px; border-style: none solid solid none; border-color: #000000 #dcdcdc #dcdcdc #000000; background-color: #f5f5f5;"&gt;&lt;SPAN style="font-family: Tahoma;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am still assuming I need something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variance Current Year - Previous Year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Year = {$(=(&lt;STRONG&gt;Year&lt;/STRONG&gt;))} &amp;gt;}Sales) - Sum({$&amp;lt;Year = {$(=(&lt;STRONG&gt;Year)-1&lt;/STRONG&gt;)} &amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other feedback?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Sep 2017 14:58:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-calculate-yr-by-yr-variances/m-p/1400998#M812138</guid>
      <dc:creator />
      <dc:date>2017-09-23T14:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate yr by yr variances</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-calculate-yr-by-yr-variances/m-p/1747354#M812139</link>
      <description>&lt;P&gt;I have been on the same footing and struggling to get answer to this problem. Ideally, it should figure out the context of the visualization and pull the numbers but for some strange reason, even if your year is, say for example 2018, instead of taking that as the maximum year, it still considers max date of the whole data set as max date. The problem seems to be that dimensions which are part of visualization are not considered filters. Best of luck. If you get the answer, please share. I am struggling as well.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 06:06:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-calculate-yr-by-yr-variances/m-p/1747354#M812139</guid>
      <dc:creator>writetoprithvi</dc:creator>
      <dc:date>2020-09-26T06:06:49Z</dc:date>
    </item>
  </channel>
</rss>

