<?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: Brackets Hell! in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789649#M279251</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem, it can be confusing when you start to nest things.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From your logic, I'd suggest the following arrangement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Left(AC2,2) = 'T8' and Month([Due Date]) = Month(Today()),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum([Line Debt]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Sum([Line Debt]) &amp;lt;= 100,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Sum([Line Debt])/100)*$(Cash Target - Line Debt &amp;lt;£100),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Sum([Line Debt])/100)*$(Cash Target - Others)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do agree that it may be better to put flags in your load script to identify these conditions however! That would definitely make it easier to follow the lines of logic to get your outcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Nov 2014 13:44:34 GMT</pubDate>
    <dc:creator>morganaaron</dc:creator>
    <dc:date>2014-11-07T13:44:34Z</dc:date>
    <item>
      <title>Brackets Hell!</title>
      <link>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789643#M279245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Argh!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong?!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(sum([Line Debt])&amp;lt;=100, (sum([Line Debt])/100)*$(Cash Target - Line Debt &amp;lt;£100) ,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;(SUM([Line Debt])/100)*$(Cash Target - Others))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Works fine, no problems.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I need to add the following, which on its own works fine as well:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(left(AC2,2)='T8',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(Month([Due Date])=Month(Today()), Sum([Line Debt])&lt;/STRONG&gt;,(sum([Line Debt])/100)*$(Cash Target - Others)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I add the bold section, highlighted above, to the first expression everything goes wrong!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where am I going wrong?!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(sum([Line Debt])&amp;lt;=100, (sum([Line Debt])/100)*$(Cash Target - Line Debt &amp;lt;£100) ,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;if(left(AC2,2)='T8', if(Month([Due Date])=Month(Today()), Sum([Line Debt]),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;(SUM([Line Debt])/100)*$(Cash Target - Others))))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Confused!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Di&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 11:32:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789643#M279245</guid>
      <dc:creator>dinicholls</dc:creator>
      <dc:date>2014-11-07T11:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Brackets Hell!</title>
      <link>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789644#M279246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hmmmm, I might have to put it into the script instead of the expression. I have that many expressions, its getting a bit chaotic!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 11:42:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789644#M279246</guid>
      <dc:creator>dinicholls</dc:creator>
      <dc:date>2014-11-07T11:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Brackets Hell!</title>
      <link>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789645#M279247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In English, what I'm trying to do is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If line debt &amp;lt; £100&amp;nbsp; sum line debt, divide by 100 and then multiply by cash target &amp;lt;100 variable, BUT&lt;/P&gt;&lt;P&gt;if AC2, left 2 = T8 AND Due date is in the current month then sum the line debt ELSE&lt;/P&gt;&lt;P&gt;sum the line debt, divide by 100 and multiply by cash target - other variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I need to write this another way?&amp;nbsp; Or am I confusing myself and eveyone else?!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Di&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 11:51:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789645#M279247</guid>
      <dc:creator>dinicholls</dc:creator>
      <dc:date>2014-11-07T11:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: Brackets Hell!</title>
      <link>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789646#M279248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No BUTs &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I mean, if the first condition&lt;/P&gt;&lt;P&gt;sum([Line Debt])&amp;lt;=100&lt;/P&gt;&lt;P&gt;is true, then the other ones are not even checked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 13:00:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789646#M279248</guid>
      <dc:creator>kuba_michalik</dc:creator>
      <dc:date>2014-11-07T13:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Brackets Hell!</title>
      <link>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789647#M279249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Diane,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the "BUT" condition you stated applicable if the line debt is &amp;lt;= 100 or applicable if NOT &amp;lt;=100?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it's the former, I think you want to close the second if statement earlier, something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Sum([Line Debt]) &amp;lt;= 100,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(left(AC2,2) = 'T8' and Month([Due Date]) = Month(Today()),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum ([Line Debt]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Sum([Line Debt])/100)*$(Cash Target - Line Debt &amp;lt;£100)),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Sum([Line Debt])/100)*$(Cash Target - Others))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question would be, what is the 'Line Debt &amp;lt;£100' text? Is that whole bracket (Cash Target - Line Debt..) a variable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps..!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 13:15:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789647#M279249</guid>
      <dc:creator>morganaaron</dc:creator>
      <dc:date>2014-11-07T13:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Brackets Hell!</title>
      <link>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789648#M279250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmmmmm,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe I need to rearrange things?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the criteria that HAS to happen:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(if left AC2,2 = T8 AND the due date is in the current month, then sum the line debt) these HAVE to go together&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it not the above, but the line debt is less than 100 then sum line debt, divide by 100 and multiply by the variable 'Cash Target - &amp;lt;100'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it doesn't fall in the above two, then &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;sum the line debt, divide by 100 and multiply by 'Cash Target - Other' variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data will fall into 1 of the above, but if it falls into 2 or more, it needs to be calculated in the order above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does that make sense?! Sorry, I keep looking at this at getting lost! I'm wondering if putting something in the script to identify the first criteria, and then referencing that in the expression might be an easier way to do things.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Di&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 13:37:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789648#M279250</guid>
      <dc:creator>dinicholls</dc:creator>
      <dc:date>2014-11-07T13:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Brackets Hell!</title>
      <link>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789649#M279251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem, it can be confusing when you start to nest things.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From your logic, I'd suggest the following arrangement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Left(AC2,2) = 'T8' and Month([Due Date]) = Month(Today()),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum([Line Debt]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Sum([Line Debt]) &amp;lt;= 100,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Sum([Line Debt])/100)*$(Cash Target - Line Debt &amp;lt;£100),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Sum([Line Debt])/100)*$(Cash Target - Others)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do agree that it may be better to put flags in your load script to identify these conditions however! That would definitely make it easier to follow the lines of logic to get your outcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 13:44:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789649#M279251</guid>
      <dc:creator>morganaaron</dc:creator>
      <dc:date>2014-11-07T13:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Brackets Hell!</title>
      <link>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789650#M279252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The plot thickens!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly, thank you, everyone for your help, it has helped no end!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have now come across another hiccup, to do with the same problem!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ended up adding a bit of script to identify the 'T8' records, so changed my expression to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if([T8 Check]='Yes', Sum([Line Debt]),&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;if(Sum([Line Debt])&amp;lt;100, (Sum([Line Debt])/100)*$(Cash Target - Line Debt &amp;lt;£100),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;(Sum([Line Debt])/100)*$(Cash Target - Others)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Except I'm finding that even though I have stated the first 'IF', when the one of the records meets the first IF, it is being overwritten by the second IF, if in fact the value is&amp;nbsp; less than 100!!!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I did try doing everything in script, and got the same result as above, hence me adding it to the script to see if it would sort the problem out.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I think the easiest way of sorting it, is to identify what records will sit where in the script, and add in new fields, then it will just be a matter of referencing them in the expression.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thank you again, I've learnt a lot and wouldn't have got this far without your help!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Di&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 14:25:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789650#M279252</guid>
      <dc:creator>dinicholls</dc:creator>
      <dc:date>2014-11-07T14:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Brackets Hell!</title>
      <link>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789651#M279253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad it's been of some help, what you're getting result wise sounds rather bizarre, it shouldn't evaluate any records that = 'Yes' to the T8 Check past the step if that is true - if you're comfortable doing so, you can attach an example of your .qvw and I'd be happy to take a look at it to see if I can spot any problems, if not I hope you find a suitable fix!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 14:34:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789651#M279253</guid>
      <dc:creator>morganaaron</dc:creator>
      <dc:date>2014-11-07T14:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Brackets Hell!</title>
      <link>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789652#M279254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One method you could try when faced with complex nested ifs, is to split up the different calculations into smaller expressions then reference the expression label in the next expression. So for example for ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(sum([Line Debt])&amp;lt;=100, (sum([Line Debt])/100)*$(Cash Target - Line Debt &amp;lt;£100) ,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;(SUM([Line Debt])/100)*$(Cash Target - Others))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st expression is: &lt;STRONG&gt;(sum([Line Debt])/100)*$(Cash Target - Line Debt &amp;lt;£100) &lt;/STRONG&gt;and labelled &lt;STRONG&gt;ColA&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2nd expression is: &lt;STRONG&gt; &lt;SPAN style="font-size: 10pt;"&gt;(SUM([Line Debt])/100)*$(Cash Target - Others)&lt;/SPAN&gt; &lt;/STRONG&gt;and labelled &lt;STRONG&gt;ColB&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;3rd expression is: &lt;STRONG&gt;if(sum([Line Debt])&amp;lt;=100,[ColA],[ColB])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then hide the first two expressions when you've got the desired result or 'expand' the last expression by copying the earlier expressions over their labels. If you're using these calculations in multiple places, then it's worth looking into storing your expressions into variables so it becomes a single point of management.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 14:42:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Brackets-Hell/m-p/789652#M279254</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2014-11-07T14:42:30Z</dc:date>
    </item>
  </channel>
</rss>

