<?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: Aggr: nesting if logic in aggr function in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Aggr-nesting-if-logic-in-aggr-function/m-p/2467778#M99391</link>
    <description>&lt;P&gt;That was it! Thanks so much!&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jul 2024 21:20:42 GMT</pubDate>
    <dc:creator>TonySchullo</dc:creator>
    <dc:date>2024-07-03T21:20:42Z</dc:date>
    <item>
      <title>Aggr: nesting if logic in aggr function</title>
      <link>https://community.qlik.com/t5/App-Development/Aggr-nesting-if-logic-in-aggr-function/m-p/2467764#M99389</link>
      <description>&lt;P&gt;I am trying to write an aggr expression that calculates taxable income at the account level, but displays it at the city/state level.&amp;nbsp; The rule is that if the sum for a given account is &amp;lt; 0, it is taxable, otherwise it's is not, so we set the taxable amount to zero (first two lines of chart below).&amp;nbsp; Taxable Amt = if(Sum(Amt)&amp;lt;0,Sum(Amt),0)&lt;/P&gt;
&lt;P&gt;For my final display, I want to NOT include account in the chart (see bottom chart) but still do the aggr at the account level, imbedding the if statement within the aggr.&lt;/P&gt;
&lt;PRE&gt;aggr(if(Sum(Amt)&amp;lt;0,Sum(Amt),0),City,State,Account)&lt;/PRE&gt;
&lt;P&gt;However this is not working for me.&lt;/P&gt;
&lt;P&gt;Can someone please help?&amp;nbsp; Desired results shown in red in bottom chart.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Tony&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TonySchullo_0-1720029713016.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/168864iA61A11893491C7FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TonySchullo_0-1720029713016.jpeg" alt="TonySchullo_0-1720029713016.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;DATA:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;City, State, Account, Amt&lt;BR /&gt;Miami, FL, 200001, 55.34&lt;BR /&gt;Miami, FL, 200002, -152.45&lt;BR /&gt;WPB, FL, 200020, -1335.00&lt;BR /&gt;WPB, FL, 200022, -765.88&lt;BR /&gt;]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 18:13:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggr-nesting-if-logic-in-aggr-function/m-p/2467764#M99389</guid>
      <dc:creator>TonySchullo</dc:creator>
      <dc:date>2024-07-03T18:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr: nesting if logic in aggr function</title>
      <link>https://community.qlik.com/t5/App-Development/Aggr-nesting-if-logic-in-aggr-function/m-p/2467775#M99390</link>
      <description>&lt;P&gt;&amp;nbsp;The whole point of AGGR is to do multi-level aggregations.&lt;/P&gt;
&lt;P&gt;Based on what you said I think just summing your original AGGR would do the trick&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sum(aggr(if(Sum(Amt)&amp;lt;0,Sum(Amt),0),City,State,Account))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Having said all that I would not use this regularly in apps with any significant volume of data. Aggr is notoriously bad for performance.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 19:30:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggr-nesting-if-logic-in-aggr-function/m-p/2467775#M99390</guid>
      <dc:creator>chriscammers</dc:creator>
      <dc:date>2024-07-03T19:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr: nesting if logic in aggr function</title>
      <link>https://community.qlik.com/t5/App-Development/Aggr-nesting-if-logic-in-aggr-function/m-p/2467778#M99391</link>
      <description>&lt;P&gt;That was it! Thanks so much!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 21:20:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggr-nesting-if-logic-in-aggr-function/m-p/2467778#M99391</guid>
      <dc:creator>TonySchullo</dc:creator>
      <dc:date>2024-07-03T21:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr: nesting if logic in aggr function</title>
      <link>https://community.qlik.com/t5/App-Development/Aggr-nesting-if-logic-in-aggr-function/m-p/2467789#M99394</link>
      <description>&lt;P&gt;What would you suggest then on larger data sets?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 21:22:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggr-nesting-if-logic-in-aggr-function/m-p/2467789#M99394</guid>
      <dc:creator>TonySchullo</dc:creator>
      <dc:date>2024-07-03T21:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr: nesting if logic in aggr function</title>
      <link>https://community.qlik.com/t5/App-Development/Aggr-nesting-if-logic-in-aggr-function/m-p/2468714#M99491</link>
      <description>&lt;P&gt;Creating a field in the data model that uses similar logic would be best. This becomes difficult if your measure is sensitive to user selections which is when AGGR is most applicable.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 13:00:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggr-nesting-if-logic-in-aggr-function/m-p/2468714#M99491</guid>
      <dc:creator>chriscammers</dc:creator>
      <dc:date>2024-07-08T13:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr: nesting if logic in aggr function</title>
      <link>https://community.qlik.com/t5/App-Development/Aggr-nesting-if-logic-in-aggr-function/m-p/2468743#M99494</link>
      <description>&lt;P&gt;Yeah, we were thinking of that option using group by.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 13:40:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggr-nesting-if-logic-in-aggr-function/m-p/2468743#M99494</guid>
      <dc:creator>TonySchullo</dc:creator>
      <dc:date>2024-07-08T13:40:29Z</dc:date>
    </item>
  </channel>
</rss>

