<?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: Before() Function in Pivot Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Before-Function-in-Pivot-Table/m-p/1204276#M387228</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Aggr(RangeSum(Sum([Inventory by Week]),-Above(TOTAL SUM([Inventory by Week]))), (YYYYQT, (NUMERIC)), (QtrWeek,(NUMERIC)))&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/142651_Capture.PNG" style="height: 74px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Nov 2016 02:02:53 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-11-02T02:02:53Z</dc:date>
    <item>
      <title>Before() Function in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Before-Function-in-Pivot-Table/m-p/1204274#M387226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement to create a pivot table to show the Inventory Weekly change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the Before () function, however I can't get the chart to display the weekly change for the first week of each quarter.&amp;nbsp; I'm attaching a sample QVW file.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.JPG" class="jive-image image-1" height="256" src="https://community.qlik.com/legacyfs/online/142644_1.JPG" style="height: 256.265px; width: 506px;" width="506" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2016 22:09:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Before-Function-in-Pivot-Table/m-p/1204274#M387226</guid>
      <dc:creator>clondono</dc:creator>
      <dc:date>2016-11-01T22:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Before() Function in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Before-Function-in-Pivot-Table/m-p/1204275#M387227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What numbers do you expect to see Carlos? This?&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/142650_Capture.PNG" style="height: 78px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think that you want this, but if you do, I used RangeSum to do this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RangeSum((SUM([Inventory by Week])),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;-(Before(SUM([Inventory by Week]))))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 01:56:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Before-Function-in-Pivot-Table/m-p/1204275#M387227</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-02T01:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Before() Function in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Before-Function-in-Pivot-Table/m-p/1204276#M387228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Aggr(RangeSum(Sum([Inventory by Week]),-Above(TOTAL SUM([Inventory by Week]))), (YYYYQT, (NUMERIC)), (QtrWeek,(NUMERIC)))&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/142651_Capture.PNG" style="height: 74px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 02:02:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Before-Function-in-Pivot-Table/m-p/1204276#M387228</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-02T02:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Before() Function in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Before-Function-in-Pivot-Table/m-p/1204277#M387229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As always thank you Sunny for your great suggestions!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the Aggr, Range Sum, Total (second solution you suggested) gets me very close to the results I am looking for.&amp;nbsp; On my data set I have YYYYQT dated earlier than YYYYQT= 20134.&amp;nbsp; So, for the first cell (QtrWeek= 1, YYYYQT = 20134 in the sample) I am expecting to see the the beginning inventory in first week of 20134 minus ending Inventory in last week 20133 (week 13). If for example, Inventory for 20133 week 13 was 65.5, I expect to see 3.0 on that first cell.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the results for the remaining weeks are accurate. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to achieve that with set analysis?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 03:28:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Before-Function-in-Pivot-Table/m-p/1204277#M387229</guid>
      <dc:creator>clondono</dc:creator>
      <dc:date>2016-11-02T03:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Before() Function in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Before-Function-in-Pivot-Table/m-p/1204278#M387230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have data prior to 20134, then I would believe it should work automatically with this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Aggr(RangeSum(Sum([Inventory by Week]),-Above(TOTAL SUM([Inventory by Week]))), (YYYYQT, (NUMERIC)), (QtrWeek,(NUMERIC)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it not working? I mean it is working for 20141 right? it is doing 20141 week 1 - 20134 week 13?, so I think it should do the same for 20131 week 1 also.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 08:25:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Before-Function-in-Pivot-Table/m-p/1204278#M387230</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-02T08:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Before() Function in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Before-Function-in-Pivot-Table/m-p/1204279#M387231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny, it works for all the years visible in the chart. I mean if there is data in a previous year not selected in the filter, the first value by default is the total inventory amount at the beginning of the quarter.&amp;nbsp; It doesn't show the change in inventory for the first week visible in the chart, instead it shows the beginning of inventory at that time.&lt;/P&gt;&lt;P&gt;I understand the limitation of the chart and I think that as long as the users understand it as well we will be OK.&lt;/P&gt;&lt;P&gt;One small change I added was defining the NUMERIC value at the beginning of the expression:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Num(Aggr(RangeSum(Sum([Inventory by Week]),-Above(TOTAL SUM([Inventory by Week]))), YYYYQT, QtrWeek)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;Thank you Sunny!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 22:07:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Before-Function-in-Pivot-Table/m-p/1204279#M387231</guid>
      <dc:creator>clondono</dc:creator>
      <dc:date>2016-11-02T22:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Before() Function in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Before-Function-in-Pivot-Table/m-p/1204280#M387232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh I see what you mean, this should resolve the issue for you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Aggr(RangeSum(Sum([Inventory by Week]),-Above(TOTAL SUM(&lt;SPAN style="color: #ff0000;"&gt;{1}&lt;/SPAN&gt;[Inventory by Week]))) &lt;SPAN style="color: #ff0000;"&gt;* Avg(1)&lt;/SPAN&gt;, (YYYYQT, (NUMERIC)), (QtrWeek,(NUMERIC)))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 22:48:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Before-Function-in-Pivot-Table/m-p/1204280#M387232</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-02T22:48:58Z</dc:date>
    </item>
  </channel>
</rss>

