<?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 Previous Quarter Calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346344#M414264</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;&lt;/P&gt;&lt;P&gt;I'm trying to resolve an issue that I think should be fairly simple, but I can't seem to get my head around it.&amp;nbsp; Maybe I've just been staring at it too long.&amp;nbsp; I need to generate a "Starting" value based on the data set below to generate the shown pivot table (obv a very simple sample set).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="160564" alt="order data.jpg" class="jive-image image-1" src="/legacyfs/online/160564_order data.jpg" style="height: 109px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "Start" amount should be, in essence, the "End" value of the previous quarter (sum(NewOrders)-sum(Invoices).&amp;nbsp; However, in order to ensure the proper flexibility of selection, I am trying to perform a calculation to generate this data set, using the order and invoice dates and the proper Quarters associated.&amp;nbsp; I think I just need to step away and maybe get a second set of eyes here, so any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start = sum(&amp;lt;Previous Qtr&amp;gt; Order Amount) - sum(&amp;lt;Previous Qtr&amp;gt; Invoice Amt)&lt;/P&gt;&lt;P&gt;New = sum(Order Amount)&lt;/P&gt;&lt;P&gt;Inv = sum(Invoice Amt)&lt;/P&gt;&lt;P&gt;End = (Start+New)-Inv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I can also attempt to script a summary data set, but if it can be done in the table expressions, that would provide me the most value.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Apr 2017 19:47:26 GMT</pubDate>
    <dc:creator>mike_landow</dc:creator>
    <dc:date>2017-04-19T19:47:26Z</dc:date>
    <item>
      <title>Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346344#M414264</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;&lt;/P&gt;&lt;P&gt;I'm trying to resolve an issue that I think should be fairly simple, but I can't seem to get my head around it.&amp;nbsp; Maybe I've just been staring at it too long.&amp;nbsp; I need to generate a "Starting" value based on the data set below to generate the shown pivot table (obv a very simple sample set).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="160564" alt="order data.jpg" class="jive-image image-1" src="/legacyfs/online/160564_order data.jpg" style="height: 109px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "Start" amount should be, in essence, the "End" value of the previous quarter (sum(NewOrders)-sum(Invoices).&amp;nbsp; However, in order to ensure the proper flexibility of selection, I am trying to perform a calculation to generate this data set, using the order and invoice dates and the proper Quarters associated.&amp;nbsp; I think I just need to step away and maybe get a second set of eyes here, so any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start = sum(&amp;lt;Previous Qtr&amp;gt; Order Amount) - sum(&amp;lt;Previous Qtr&amp;gt; Invoice Amt)&lt;/P&gt;&lt;P&gt;New = sum(Order Amount)&lt;/P&gt;&lt;P&gt;Inv = sum(Invoice Amt)&lt;/P&gt;&lt;P&gt;End = (Start+New)-Inv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I can also attempt to script a summary data set, but if it can be done in the table expressions, that would provide me the most value.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Apr 2017 19:47:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346344#M414264</guid>
      <dc:creator>mike_landow</dc:creator>
      <dc:date>2017-04-19T19:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346345#M414265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to do like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Variable Creation &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET VPriorQuarter&amp;nbsp; =Ceil(num(month(addmonths(max(DateFieldofQuarter),-3)))/3)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Then use these expressions&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;1) Start&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;sum({&amp;lt;&lt;STRONG style="font-size: 13.3333px;"&gt;DateFieldofQuarter&lt;/STRONG&gt; = {'=$(=&lt;SPAN style="font-size: 13.3333px;"&gt;VPriorQuarter&lt;/SPAN&gt;)'}&amp;gt;} [Order Amount]) - sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;{&amp;lt;&lt;STRONG style="font-size: 13.3333px;"&gt;DateFieldofQuarter&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; = {'=$(=&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;VPriorQuarter&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;)'}&amp;gt;}&lt;/SPAN&gt; [Invoice Amt])&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;2) New&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;sum([Order Amount])&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;3) Inv&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;sum([Invoice Amt])&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;4) End&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;(Column(1) + Column(2)) - Column(3)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 03:02:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346345#M414265</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-04-20T03:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346346#M414266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This only works if I have a Quarter (or any date) selected.&amp;nbsp; I need this to work with or without selections being made.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 12:27:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346346#M414266</guid>
      <dc:creator>mike_landow</dc:creator>
      <dc:date>2017-04-20T12:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346347#M414267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be like this:&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;Start = &lt;STRONG&gt;(Before(Sum({&amp;lt;Quarter&amp;gt;}Order Amount)) - Before(Sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;{&amp;lt;Quarter&amp;gt;}&lt;/SPAN&gt;Invoice Amt))) * Avg(1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;New = &lt;STRONG&gt;Sum(Order Amount)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Inv = &lt;STRONG&gt;Sum(Invoice Amt)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;End = &lt;STRONG&gt;(Start+New)-Inv&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I am assuming that you are going to try this in a pivot table where Quarter is pivoted. I have only ignore selection in just Quarter field, but ignore selection in all date and time related fields where you plan to make selections (Start expression)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 12:31:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346347#M414267</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-04-20T12:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346348#M414268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is definitely on the right track.&amp;nbsp; It is a Pivot table with the Quarter pivoted.&amp;nbsp; It seems that this does get the previous Quarter data, but not the previous quarter "Remaining" as the current Quarter start point.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, in the data set provided, Q1-2017 actually ends up with a Start value of -400 (instead of 500) due to the amount of New and Invoices in Q4-2016, but not carrying over the Starting value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 13:03:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346348#M414268</guid>
      <dc:creator>mike_landow</dc:creator>
      <dc:date>2017-04-20T13:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346349#M414269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share a sample to look at this... because as far as I understand, this should get the remaining value....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 13:06:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346349#M414269</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-04-20T13:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346350#M414270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;I mocked up a bit of data that is based on the live data.&amp;nbsp; Just a small sample of Orders and Invoices.&amp;nbsp; This is basically the set structure I'm working with.&amp;nbsp; I attached it to the main Post of this discussion - since doesn't seem I can attach it to the reply.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Right now a Pivot Table in QlikView or Qlik Sense is the goal, but will potentially want a waterfall design view down the line.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;I think part of the issue is "gaps" in the date sequence as well, so there may be a need to fill the gaps of data appropriately, and I'm also looking at that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 13:51:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346350#M414270</guid>
      <dc:creator>mike_landow</dc:creator>
      <dc:date>2017-04-20T13:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346351#M414271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How have you created your calendar here? Have you used &lt;A href="https://community.qlik.com/qlik-blogpost/3585"&gt;Canonical Date&lt;/A&gt; approach or another approach? The reason I ask is that it seems that you need have two types of dates and you will need to create Quarter field from the combination of two... just wonder how you have done it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, check here to see how you can attach to a response&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-16454"&gt;Uploading a Sample&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 13:57:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346351#M414271</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-04-20T13:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346352#M414272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah!&amp;nbsp; Thanks for the tip of the "Advanced Editor".&amp;nbsp; I saw that, but missed the attach icon at the bottom.&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as the calendar goes, I have used a similar method to the Canonical Date approach, although I do not have a separate calendar for each date.&amp;nbsp; There is a company master calendar data set that I am loading in.&amp;nbsp; This set has all the information related to a date in regards to QTR, Month, Year, Fiscal Month, etc.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a Link table that allows for the use of a singular date selection, but ability to use Order Date and Invoice Date together, as necessary.&amp;nbsp; This is linked to the Orders and Invoices based on a key created using the order number/line of business/(order or invoice) date.&amp;nbsp; (Whether it is working correctly...that's another story &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;IMG alt="data_model.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/160674_data_model.jpg" style="height: 282px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 14:21:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346352#M414272</guid>
      <dc:creator>mike_landow</dc:creator>
      <dc:date>2017-04-20T14:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346353#M414273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to be consistent, would you be able to share the script you used to create the link table and calendar?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 14:28:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346353#M414273</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-04-20T14:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346354#M414274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sample code attached.&amp;nbsp; Note that the Calendar has standard calendar fields and fiscal (ENT_ prefix).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not certain my code is correct either, so I am more than open to suggestions.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As some additional thought processes, in reality, the calculation I need is the aggregation summation of (new orders)-(invoices) over the time period prior to the dimension of the table.&amp;nbsp; So, for say, Q1-2017, I would want the sum of all new orders - total invoices for all dates prior to the start of Q1-2017, which would give me my "Start" value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 16:37:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346354#M414274</guid>
      <dc:creator>mike_landow</dc:creator>
      <dc:date>2017-04-20T16:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346355#M414275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does that look right to you or not?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/160688_Capture.PNG" style="height: 57px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 17:01:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346355#M414275</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-04-20T17:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346356#M414276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that looks pretty good.&amp;nbsp; I think you hit on what I was missing, which is filling in the "gaps" in the date sequences to get the sequential quarters to work properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me work with this for a bit and I'll get back on here either way. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for all your help Sunny!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 17:05:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346356#M414276</guid>
      <dc:creator>mike_landow</dc:creator>
      <dc:date>2017-04-20T17:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346357#M414277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny.&amp;nbsp; I think that this is very close, and I'm going to play around with it a little, but it appears to break down if we change the sort of the chart.&amp;nbsp; The chart needs to be sorted by Quarters asc, so Q4-2015, Q1-2016, Q2-2016, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The chart you built works great, but the sorting is incorrect - Q1-2017, Q2-2016, Q3-2016.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change the sort order to align properly, the chart changes its presentation to this:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="sort_order.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/160736_sort_order.jpg" style="height: 36px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;If you look at Q2-2016, it sets the Start value to 0, because this is only looking at the previous quarter New/Inv data, but in reality, it needs to aggregate all the New/Inv numbers for all previous quarters.&amp;nbsp; That is another approach I am looking into.&amp;nbsp; To not necessarily focus on a quarter-by-quarter calculation, but just aggregating previous quarterly data over time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 22:50:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346357#M414277</guid>
      <dc:creator>mike_landow</dc:creator>
      <dc:date>2017-04-20T22:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346358#M414278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you change the sorting and you still want the same result, then you can use After instead of Before&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/160726_Capture.PNG" style="height: 46px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 01:40:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346358#M414278</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-04-21T01:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346359#M414279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still not quite right.&amp;nbsp; If you add the dimensions for LOB and Sales Order, the numbers don't add up.&amp;nbsp; I think this has to include some combination of the before/after expression, but also a RangeSum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In essence, this is a rolling sum of the New-Inv amounts over time, presented within each Quarter.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 12:56:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346359#M414279</guid>
      <dc:creator>mike_landow</dc:creator>
      <dc:date>2017-04-21T12:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346360#M414280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the output you expect to see? May be if I know the numbers I am able to get, I might be able to help better &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 12:58:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346360#M414280</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-04-21T12:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346361#M414281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny.&amp;nbsp; I probably should have created a better sample screenshot at the initial post &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;Based on the mocked up data, this is roughly what I am trying to get created:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="160844" alt="results.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/160844_results.jpg" style="height: 94px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you'll notice, the Start value for each quarter is, basically, the running total of (New-Inv) over the previous timeframes, and the End value is the addition of that Quarters (New-Inv).&amp;nbsp; So, it really is more of a running sum, than necessarily a Previous Quarter calculation.&amp;nbsp; And that is my mistake as to how I presented it in the initial thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 0 values don't need to be displayed as such.&amp;nbsp; Nulls() are OK, as long as the overall numbers sum properly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 13:34:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346361#M414281</guid>
      <dc:creator>mike_landow</dc:creator>
      <dc:date>2017-04-21T13:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346362#M414282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here (besides some potential typos in your attachement above the expression seems to work) this seems to be working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RangeSum(Before(Sum({&amp;lt;QuarterYear&amp;gt;}[Order Amount]), 1, ColumnNo())) - RangeSum(Before(Sum({&amp;lt;QuarterYear&amp;gt;}[Total Global Rev Amt]), 1, ColumnNo())) * Avg(TOTAL 1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/160847_Capture.PNG" style="height: 79px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 13:55:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346362#M414282</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-04-21T13:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Quarter Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346363#M414283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Sunny!&amp;nbsp; (Guess I should have finished my morning coffee before trying to do math in my head to make that chart &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;This looks like it's working exactly as I need it.&amp;nbsp; Or, at least it gets me over the hurdle to move forward.&amp;nbsp; Thank you for all your help.&amp;nbsp; I really do appreciate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're my hero for sure today!&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 14:46:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Quarter-Calculation/m-p/1346363#M414283</guid>
      <dc:creator>mike_landow</dc:creator>
      <dc:date>2017-04-21T14:46:42Z</dc:date>
    </item>
  </channel>
</rss>

