<?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 Setting a flag when a -ve value is present in an expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Setting-a-flag-when-a-ve-value-is-present-in-an-expression/m-p/1069191#M357246</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I have the following pivot table:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="116574" alt="Capture.PNG" class="jive-image image-1" height="151" src="https://community.qlik.com/legacyfs/online/116574_Capture.PNG" style="height: 151px; width: 786.723px;" width="787" /&gt;&lt;/P&gt;&lt;P&gt;The expressions are the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - &lt;SPAN style="text-decoration: underline;"&gt;Opening Balance&lt;/SPAN&gt;: The balance of the item at the start of the week. The current week is what we currently have in stock and &lt;STRONG&gt;the other weeks are the value carried forward from the 'Bal. Carried Forward' expression.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - &lt;SPAN style="text-decoration: underline;"&gt;MRP Schedules&lt;/SPAN&gt;: These are incoming schedules on the item at that particular week&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - &lt;SPAN style="text-decoration: underline;"&gt;Total&lt;/SPAN&gt;: This is the 'Opening Balance' + 'MRP Schedules'. This is done by directly referring to the expressions (ie. [09.&amp;nbsp;&amp;nbsp; Opening Bal.] + [10.&amp;nbsp;&amp;nbsp; MRP Schedules])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - &lt;SPAN style="text-decoration: underline;"&gt;MRP Demand&lt;/SPAN&gt;: The demand that we have from the customer at that particular week.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - &lt;SPAN style="text-decoration: underline;"&gt;Bal. Carried Fwd&lt;/SPAN&gt;: This is the 'Total' - 'MRP Demand'. &lt;STRONG&gt;This values is then carried forward to the 'Opening Bal.' of next week.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is to display an alert if at least we have one 'Bal. Carried Fwd' with a negative value, as the case in yearweek 201609 (marked as red). I was thinking of setting a flag variable ex. vNegBalFlag where the value is set to 'N' if there isn't a 'Bal Carried Forward' with a -ve value or 'Y' otherwise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I am finding this challenging since (unlike say MRP Demand which is brought in from a QVD) the 'Bal. Carried Fwd' field is calculated using a value from the previous week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a why how I can flag such a -ve Balance?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also attached a simplified QVW to understand better what I am trying to achieve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Mar 2016 09:23:08 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-03-02T09:23:08Z</dc:date>
    <item>
      <title>Setting a flag when a -ve value is present in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-a-flag-when-a-ve-value-is-present-in-an-expression/m-p/1069191#M357246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I have the following pivot table:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="116574" alt="Capture.PNG" class="jive-image image-1" height="151" src="https://community.qlik.com/legacyfs/online/116574_Capture.PNG" style="height: 151px; width: 786.723px;" width="787" /&gt;&lt;/P&gt;&lt;P&gt;The expressions are the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - &lt;SPAN style="text-decoration: underline;"&gt;Opening Balance&lt;/SPAN&gt;: The balance of the item at the start of the week. The current week is what we currently have in stock and &lt;STRONG&gt;the other weeks are the value carried forward from the 'Bal. Carried Forward' expression.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - &lt;SPAN style="text-decoration: underline;"&gt;MRP Schedules&lt;/SPAN&gt;: These are incoming schedules on the item at that particular week&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - &lt;SPAN style="text-decoration: underline;"&gt;Total&lt;/SPAN&gt;: This is the 'Opening Balance' + 'MRP Schedules'. This is done by directly referring to the expressions (ie. [09.&amp;nbsp;&amp;nbsp; Opening Bal.] + [10.&amp;nbsp;&amp;nbsp; MRP Schedules])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - &lt;SPAN style="text-decoration: underline;"&gt;MRP Demand&lt;/SPAN&gt;: The demand that we have from the customer at that particular week.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - &lt;SPAN style="text-decoration: underline;"&gt;Bal. Carried Fwd&lt;/SPAN&gt;: This is the 'Total' - 'MRP Demand'. &lt;STRONG&gt;This values is then carried forward to the 'Opening Bal.' of next week.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is to display an alert if at least we have one 'Bal. Carried Fwd' with a negative value, as the case in yearweek 201609 (marked as red). I was thinking of setting a flag variable ex. vNegBalFlag where the value is set to 'N' if there isn't a 'Bal Carried Forward' with a -ve value or 'Y' otherwise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I am finding this challenging since (unlike say MRP Demand which is brought in from a QVD) the 'Bal. Carried Fwd' field is calculated using a value from the previous week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a why how I can flag such a -ve Balance?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also attached a simplified QVW to understand better what I am trying to achieve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 09:23:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-a-flag-when-a-ve-value-is-present-in-an-expression/m-p/1069191#M357246</guid>
      <dc:creator />
      <dc:date>2016-03-02T09:23:08Z</dc:date>
    </item>
  </channel>
</rss>

