<?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 on Pivot Table not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Before-function-on-Pivot-Table-not-working/m-p/1664332#M449053</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;Note that it is not "Stock Actual" what is failing in 1DD001 on August, it is Stock Prev. on July actually.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jaime.&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jan 2020 07:24:45 GMT</pubDate>
    <dc:creator>jaibau1993</dc:creator>
    <dc:date>2020-01-10T07:24:45Z</dc:date>
    <item>
      <title>Before function on Pivot Table not working</title>
      <link>https://community.qlik.com/t5/QlikView/Before-function-on-Pivot-Table-not-working/m-p/1663705#M449004</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've been looking in the community about this issue but nothing I found worked, so here I am.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on a Pivot table for stock projection over the next months. This table starts with the current stock, and based on the orders, forecast, etc, at the end of each month there will be a new amount that will be passed on to the next month as inital amount and so forth.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The expression I'm using to calculate the stock at the end of the month is rather complex, since many conditions are taken into account, then, for the calculation of the initial stock for the next month I use the "Before" function to read the final stock figure for the previous month.&lt;/P&gt;&lt;P&gt;This "Before" function works well for most months and products, but sometimes and I guess randomly (haven't found a pattern) it won't work, therefore giving the following months a wrong figure as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, when I select a specific product, it will work always&lt;/P&gt;&lt;P&gt;The expression for &lt;STRONG&gt;Stock Actual&lt;/STRONG&gt; (the one failing) is:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;EM&gt;If(Mes=MonthName(vToday),Sum(ProductStock),RangeSum(Before([Stock Prev.]),0))&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;gt;&amp;gt;&amp;gt; note that [Stock Prev.] is the name of an expression, not a field&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The expression for &lt;STRONG&gt;Stock Prev&lt;/STRONG&gt; is attached&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="capture.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/26536i53895E704F45D7C3/image-size/large?v=v2&amp;amp;px=999" role="button" title="capture.png" alt="capture.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any idea to solve this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 19:20:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Before-function-on-Pivot-Table-not-working/m-p/1663705#M449004</guid>
      <dc:creator>j_nlucas</dc:creator>
      <dc:date>2024-11-16T19:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Before function on Pivot Table not working</title>
      <link>https://community.qlik.com/t5/QlikView/Before-function-on-Pivot-Table-not-working/m-p/1663923#M449021</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;Can you share a sample app that reproduces this behaviour? It is quite complex to figure out what is actually happening there since&amp;nbsp;&lt;STRONG&gt;Stock Prev&amp;nbsp;&lt;/STRONG&gt;uses "before" functions too. I think the problem may be due to &lt;EM&gt;before(Expression with more before's)&lt;/EM&gt;&amp;nbsp;but it is just a guess.&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jaime.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 08:10:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Before-function-on-Pivot-Table-not-working/m-p/1663923#M449021</guid>
      <dc:creator>jaibau1993</dc:creator>
      <dc:date>2020-01-09T08:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Before function on Pivot Table not working</title>
      <link>https://community.qlik.com/t5/QlikView/Before-function-on-Pivot-Table-not-working/m-p/1664022#M449025</link>
      <description>&lt;P&gt;Hi Jaime,&lt;/P&gt;&lt;P&gt;I just left a qvw attached to the post.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 11:06:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Before-function-on-Pivot-Table-not-working/m-p/1664022#M449025</guid>
      <dc:creator>j_nlucas</dc:creator>
      <dc:date>2020-01-09T11:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Before function on Pivot Table not working</title>
      <link>https://community.qlik.com/t5/QlikView/Before-function-on-Pivot-Table-not-working/m-p/1664070#M449029</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I bet the problem radicates in your expressions complexity. Stock Prev. is a recursive expression and Stock Actual is a before of a recursive expression... it definetely brokes my mind (not conceptualy but on how QlikView maneges so)&lt;/P&gt;&lt;P&gt;BUT, you can avoid the before in Stock Actual. I used the following expression for Stock Actual:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;If(Mes=MonthName(vToday),Sum(ProductStock),

	If(Left(ItemNo,2)='1D',        
	
		if(sum(KilosPdtes) &amp;lt; sum(KilosFC),
			Column(7)+Column(2)-Column(5),
		    Column(7)+Column(4)-Column(5))
	,
                                                
	If(Left(ItemNo,2)='1C',                           
    	'whatever'
	))
)  &lt;/LI-CODE&gt;&lt;P&gt;And I obtained the following output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="before.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/26600i42FAEF3B913401CC/image-size/large?v=v2&amp;amp;px=999" role="button" title="before.png" alt="before.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is apparently solved... except for Stock Prev. In the qvw file you attached Stock Prev. is wrong in some way. In simple words, in jul 2020 it should be 442.961 - 11.712 + 0 and it is definetly not -4.030. But 7.682 ("wrong" Stock Actual) - 11.712 + 0 is, indeed, -4.030. Thus, I bet the problem is actually in Stock Prev. Try to figure it out! (you know better how to build it, i tried to solve Stock Prev. too but I could not).&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jaime.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 12:16:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Before-function-on-Pivot-Table-not-working/m-p/1664070#M449029</guid>
      <dc:creator>jaibau1993</dc:creator>
      <dc:date>2020-01-09T12:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Before function on Pivot Table not working</title>
      <link>https://community.qlik.com/t5/QlikView/Before-function-on-Pivot-Table-not-working/m-p/1664200#M449034</link>
      <description>&lt;P&gt;Hi Jaime,&lt;/P&gt;&lt;P&gt;Thanks for your reply. I tried that but unfortunately it also fails.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your image attached, you can appreciate it in the first product 1DD001. August is taking a different stock than the one in July.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 17:37:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Before-function-on-Pivot-Table-not-working/m-p/1664200#M449034</guid>
      <dc:creator>j_nlucas</dc:creator>
      <dc:date>2020-01-09T17:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Before function on Pivot Table not working</title>
      <link>https://community.qlik.com/t5/QlikView/Before-function-on-Pivot-Table-not-working/m-p/1664332#M449053</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;Note that it is not "Stock Actual" what is failing in 1DD001 on August, it is Stock Prev. on July actually.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jaime.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 07:24:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Before-function-on-Pivot-Table-not-working/m-p/1664332#M449053</guid>
      <dc:creator>jaibau1993</dc:creator>
      <dc:date>2020-01-10T07:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Before function on Pivot Table not working</title>
      <link>https://community.qlik.com/t5/QlikView/Before-function-on-Pivot-Table-not-working/m-p/1664357#M449056</link>
      <description>&lt;P&gt;Hi Jaime,&lt;/P&gt;&lt;P&gt;Thanks for pointing that out. You have definitely been quite helpful. Thanks a lot.&lt;/P&gt;&lt;P&gt;Joaquin&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 08:36:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Before-function-on-Pivot-Table-not-working/m-p/1664357#M449056</guid>
      <dc:creator>j_nlucas</dc:creator>
      <dc:date>2020-01-10T08:36:04Z</dc:date>
    </item>
  </channel>
</rss>

