<?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: calculating value from different rows in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/calculating-value-from-different-rows/m-p/618473#M227916</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks a lot for the examples. I will go through them and report back to you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I've tested several approaches and I think Rob's solution is the most suitable for me right now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Feb 2014 06:29:23 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-02-24T06:29:23Z</dc:date>
    <item>
      <title>calculating value from different rows</title>
      <link>https://community.qlik.com/t5/QlikView/calculating-value-from-different-rows/m-p/618468#M227911</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;sorry, the title might not be "very" clear.&lt;/P&gt;&lt;P&gt;This is about calculating the net value of a gross value based on the value of two other fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Task:&lt;/P&gt;&lt;P&gt;I have debtors who have an order number with one or more position(s) inside each order. Each position has a condition type (tax or discount) with an according numeric value in another column. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Debitor&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;OrderNo&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Position&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;ConditionType&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;ConditionValue&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Debtor A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;010&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;TAX&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Debtor A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;020&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;DISC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the value in ConditionType TAX is &amp;gt; 0 and DISC exists and is &amp;gt; 0 then I want to calculate the &lt;STRONG&gt;net&lt;/STRONG&gt; DISC value (in this case divide 20/1,19).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have no clue how to do this since these information are stored in different rows.&lt;/P&gt;&lt;P&gt;Hope you have an idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you,&lt;/P&gt;&lt;P&gt;Thorsten&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2014 13:58:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculating-value-from-different-rows/m-p/618468#M227911</guid>
      <dc:creator />
      <dc:date>2014-02-21T13:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: calculating value from different rows</title>
      <link>https://community.qlik.com/t5/QlikView/calculating-value-from-different-rows/m-p/618469#M227912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thorsten,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) I would load a temp table where you will populate the valid OrderNo&lt;/P&gt;&lt;P&gt;(several tables if you have several conditions on different lines)&lt;/P&gt;&lt;P&gt;Temp1:&lt;/P&gt;&lt;P&gt;LOAD OrderNo as TemporderNo1&lt;/P&gt;&lt;P&gt;WHERE ConditionType= 'TAX' and ConditionalValue &amp;gt; 0&lt;/P&gt;&lt;P&gt;// if there are several conditions, each time with an AND logic&lt;/P&gt;&lt;P&gt;Temp2:&lt;/P&gt;&lt;P&gt;LOAD OrderNo as TemporderNo2&lt;/P&gt;&lt;P&gt;WHERE ConditionType= 'DISC' and ConditionalValue &amp;gt; 0 and exists('TemporderNo1' OrderNo)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) I would load the final table based on the existence of the temp field populated with the tests&lt;/P&gt;&lt;P&gt;FinalTable:&lt;/P&gt;&lt;P&gt;LOAD ....&lt;/P&gt;&lt;P&gt; ConditionalValue/1,19 as netvalue&lt;/P&gt;&lt;P&gt;FROM ...&lt;/P&gt;&lt;P&gt;Where exists('Temporderno2', OrderNo) and&amp;nbsp; ConditionType= 'DISC'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fabrice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2014 15:05:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculating-value-from-different-rows/m-p/618469#M227912</guid>
      <dc:creator />
      <dc:date>2014-02-21T15:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: calculating value from different rows</title>
      <link>https://community.qlik.com/t5/QlikView/calculating-value-from-different-rows/m-p/618470#M227913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Thorsten,&lt;/P&gt;&lt;P&gt;Please check out the attached file and see if it helps. I used the expression as Value/119. You can change it per your needs. This will give you an idea of how to proceed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;AJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2014 17:21:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculating-value-from-different-rows/m-p/618470#M227913</guid>
      <dc:creator />
      <dc:date>2014-02-21T17:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: calculating value from different rows</title>
      <link>https://community.qlik.com/t5/QlikView/calculating-value-from-different-rows/m-p/618471#M227914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have maximum two rows for Debitor, OrderNo you can join the two rows to have 1 row with all fields for every Debitor, OrderNo&lt;/P&gt;&lt;P&gt;Calculation will be simplified &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2014 17:22:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculating-value-from-different-rows/m-p/618471#M227914</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-02-21T17:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: calculating value from different rows</title>
      <link>https://community.qlik.com/t5/QlikView/calculating-value-from-different-rows/m-p/618472#M227915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming Debtior and OrderNo are your chart dimensions, you can something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=if(sum({&amp;lt;ConditionType={'TAX'}&amp;gt;}ConditionValue)&amp;gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;,sum({&amp;lt;ConditionType={'DISC'}&amp;gt;}ConditionValue) / 1.19&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;,sum({&amp;lt;ConditionType={'DISC'}&amp;gt;}ConditionValue)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See also&lt;/P&gt;&lt;P&gt;&lt;A href="http://qlikviewnotes.blogspot.com/2013/07/calculating-duration-using-to-rows.html" title="http://qlikviewnotes.blogspot.com/2013/07/calculating-duration-using-to-rows.html"&gt;Qlikview Notes: Calculating a Duration Using Two Rows&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2014 17:52:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculating-value-from-different-rows/m-p/618472#M227915</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2014-02-21T17:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: calculating value from different rows</title>
      <link>https://community.qlik.com/t5/QlikView/calculating-value-from-different-rows/m-p/618473#M227916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks a lot for the examples. I will go through them and report back to you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I've tested several approaches and I think Rob's solution is the most suitable for me right now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2014 06:29:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculating-value-from-different-rows/m-p/618473#M227916</guid>
      <dc:creator />
      <dc:date>2014-02-24T06:29:23Z</dc:date>
    </item>
  </channel>
</rss>

