<?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 Prior year calculation problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Prior-year-calculation-problem/m-p/183544#M48759</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;H3&gt;Hi guys. Currently I have a actual sales calculation like this&lt;/H3&gt;&lt;P&gt;&lt;B&gt;=sum&lt;/B&gt;(&lt;B&gt;SalesAmount&lt;/B&gt;)-&lt;B&gt;sum&lt;/B&gt;(&lt;B&gt;SalesAmount&lt;/B&gt;*(&lt;B&gt;DiscPrcnt&lt;/B&gt;/100))-&lt;B&gt;sum&lt;/B&gt;(&lt;B&gt;CreditAmount&lt;/B&gt;)+&lt;B&gt;sum&lt;/B&gt;(&lt;B&gt;CreditAmount&lt;/B&gt;*(&lt;B&gt;CNDiscPrcnt&lt;/B&gt;/100))&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to compare prior year actual sales with current year actual sales. I got this formula in the forums:&lt;/P&gt;&lt;P&gt;&lt;B&gt;num&lt;/B&gt;(&lt;B&gt;sum&lt;/B&gt;({$&amp;lt;&lt;B&gt;Year&lt;/B&gt; = {&lt;B&gt;&lt;I&gt;$(=only(Year) - 1)&lt;/I&gt;&lt;/B&gt;}, &lt;B&gt;Month&lt;/B&gt; = {&lt;B&gt;"&amp;lt;=$(=max(Month))"&lt;/B&gt;}&amp;gt;} &lt;B&gt;SalesAmount&lt;/B&gt;), '#,##0;(#,##0)')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not know how to place the actual sales calculation as mentioned on top into this formula. As you will see that this formula only sum(SalesAmount), but I need to add the whole calc as shown on top.&lt;/P&gt;&lt;P&gt;Could someone please assist me. It looks like some simple answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Jun 2010 08:25:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-06-10T08:25:05Z</dc:date>
    <item>
      <title>Prior year calculation problem</title>
      <link>https://community.qlik.com/t5/QlikView/Prior-year-calculation-problem/m-p/183544#M48759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;H3&gt;Hi guys. Currently I have a actual sales calculation like this&lt;/H3&gt;&lt;P&gt;&lt;B&gt;=sum&lt;/B&gt;(&lt;B&gt;SalesAmount&lt;/B&gt;)-&lt;B&gt;sum&lt;/B&gt;(&lt;B&gt;SalesAmount&lt;/B&gt;*(&lt;B&gt;DiscPrcnt&lt;/B&gt;/100))-&lt;B&gt;sum&lt;/B&gt;(&lt;B&gt;CreditAmount&lt;/B&gt;)+&lt;B&gt;sum&lt;/B&gt;(&lt;B&gt;CreditAmount&lt;/B&gt;*(&lt;B&gt;CNDiscPrcnt&lt;/B&gt;/100))&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to compare prior year actual sales with current year actual sales. I got this formula in the forums:&lt;/P&gt;&lt;P&gt;&lt;B&gt;num&lt;/B&gt;(&lt;B&gt;sum&lt;/B&gt;({$&amp;lt;&lt;B&gt;Year&lt;/B&gt; = {&lt;B&gt;&lt;I&gt;$(=only(Year) - 1)&lt;/I&gt;&lt;/B&gt;}, &lt;B&gt;Month&lt;/B&gt; = {&lt;B&gt;"&amp;lt;=$(=max(Month))"&lt;/B&gt;}&amp;gt;} &lt;B&gt;SalesAmount&lt;/B&gt;), '#,##0;(#,##0)')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not know how to place the actual sales calculation as mentioned on top into this formula. As you will see that this formula only sum(SalesAmount), but I need to add the whole calc as shown on top.&lt;/P&gt;&lt;P&gt;Could someone please assist me. It looks like some simple answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jun 2010 08:25:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Prior-year-calculation-problem/m-p/183544#M48759</guid>
      <dc:creator />
      <dc:date>2010-06-10T08:25:05Z</dc:date>
    </item>
    <item>
      <title>Prior year calculation problem</title>
      <link>https://community.qlik.com/t5/QlikView/Prior-year-calculation-problem/m-p/183545#M48760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=num(&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year = {$(=only(Year) - 1)}, Month = {"&amp;lt;=$(=max(Month))"}&amp;gt;} SalesAmount)-&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year = {$(=only(Year) - 1)}, Month = {"&amp;lt;=$(=max(Month))"}&amp;gt;} SalesAmount*(DiscPrcnt/100))-&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year = {$(=only(Year) - 1)}, Month = {"&amp;lt;=$(=max(Month))"}&amp;gt;} CreditAmount)+&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year = {$(=only(Year) - 1)}, Month = {"&amp;lt;=$(=max(Month))"}&amp;gt;} CreditAmount*(CNDiscPrcnt/100))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;, '#,##0;(#,##0)')&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jun 2010 13:06:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Prior-year-calculation-problem/m-p/183545#M48760</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-06-10T13:06:27Z</dc:date>
    </item>
    <item>
      <title>Prior year calculation problem</title>
      <link>https://community.qlik.com/t5/QlikView/Prior-year-calculation-problem/m-p/183546#M48761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thank you. This works perfectly.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jun 2010 13:12:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Prior-year-calculation-problem/m-p/183546#M48761</guid>
      <dc:creator />
      <dc:date>2010-06-10T13:12:34Z</dc:date>
    </item>
  </channel>
</rss>

