<?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 Need help with an even more complex nested IF statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-help-with-an-even-more-complex-nested-IF-statement/m-p/716240#M1070747</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thought I could pull this off with what Ram just helped me with, but this one had a greater number of outcomes and not sure which to approach first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result column I am populating is called Excess_Allocation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The columns I am using for this are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Flag&lt;/P&gt;&lt;P&gt;Excess&lt;/P&gt;&lt;P&gt;Allowance&lt;/P&gt;&lt;P&gt;Fees&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logic goes like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF Flag = ' '&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF Fees &amp;gt; Allowance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND SUM(Excess) &amp;gt; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND SUM(Excess) &amp;gt; Fees - Allowance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THEN Excess_Allocation = Fees - Allowance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF Fees &amp;gt; Allowance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND SUM(Excess) &amp;gt; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND SUM(Excess) &amp;lt; Fees - Allowance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THEN Excess_Allocation = SUM(Excess) * (Fees - Allowance) / (SUM(Fees) - SUM(Allowance))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF Fees &amp;lt; Allowance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THEN Excess_Allocation = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF Flag = 'x'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THEN Excess_Allocation = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Aug 2014 15:49:29 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-08-20T15:49:29Z</dc:date>
    <item>
      <title>Need help with an even more complex nested IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-an-even-more-complex-nested-IF-statement/m-p/716240#M1070747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thought I could pull this off with what Ram just helped me with, but this one had a greater number of outcomes and not sure which to approach first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result column I am populating is called Excess_Allocation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The columns I am using for this are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Flag&lt;/P&gt;&lt;P&gt;Excess&lt;/P&gt;&lt;P&gt;Allowance&lt;/P&gt;&lt;P&gt;Fees&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logic goes like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF Flag = ' '&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF Fees &amp;gt; Allowance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND SUM(Excess) &amp;gt; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND SUM(Excess) &amp;gt; Fees - Allowance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THEN Excess_Allocation = Fees - Allowance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF Fees &amp;gt; Allowance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND SUM(Excess) &amp;gt; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND SUM(Excess) &amp;lt; Fees - Allowance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THEN Excess_Allocation = SUM(Excess) * (Fees - Allowance) / (SUM(Fees) - SUM(Allowance))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF Fees &amp;lt; Allowance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THEN Excess_Allocation = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF Flag = 'x'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THEN Excess_Allocation = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 15:49:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-an-even-more-complex-nested-IF-statement/m-p/716240#M1070747</guid>
      <dc:creator />
      <dc:date>2014-08-20T15:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with an even more complex nested IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-an-even-more-complex-nested-IF-statement/m-p/716241#M1070748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;Where you are trying to do at Script level or at the Expression, Can you also give me the sample data file. So i can work and get back to you.&lt;/P&gt;&lt;P&gt;-Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 15:58:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-an-even-more-complex-nested-IF-statement/m-p/716241#M1070748</guid>
      <dc:creator />
      <dc:date>2014-08-20T15:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with an even more complex nested IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-an-even-more-complex-nested-IF-statement/m-p/716242#M1070749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its an Expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The columns all hold numbers really, except Flag, which uses either an x or a ''.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 16:09:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-an-even-more-complex-nested-IF-statement/m-p/716242#M1070749</guid>
      <dc:creator />
      <dc:date>2014-08-20T16:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with an even more complex nested IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-an-even-more-complex-nested-IF-statement/m-p/716243#M1070750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;Can you try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Flag='',&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(Fees &amp;gt; Allowance and sum(Excess) &amp;gt; 0 and sum(Excess) &amp;gt; (Fees-Allowance),Fees-Allowance, &lt;/P&gt;&lt;P&gt;&amp;nbsp; if(Fees &amp;gt; Allowance and sum(Excess)&amp;gt;0 and sum(Excess) &amp;lt; (Fees-Allowance), ((sum(Excess)*Fees-Allowance)/ (sum(Fees)-sum(Allowance))),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (Fees &amp;lt; Allowance, 0)),0),0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure whether this will work, but with tweaks with the braces you can make it work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 16:20:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-an-even-more-complex-nested-IF-statement/m-p/716243#M1070750</guid>
      <dc:creator />
      <dc:date>2014-08-20T16:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with an even more complex nested IF statement</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-an-even-more-complex-nested-IF-statement/m-p/716244#M1070751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok I will give it a go many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 18:32:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-an-even-more-complex-nested-IF-statement/m-p/716244#M1070751</guid>
      <dc:creator />
      <dc:date>2014-08-20T18:32:31Z</dc:date>
    </item>
  </channel>
</rss>

