<?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: Sum deeper than filter in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sum-deeper-than-filter/m-p/2453564#M98192</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for all the replies.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think using this in data load I will not have the result that I want since it depends on all filters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to use something like "Sum(Aggr(Sum()))" , so Sum all the C-D, agreggate and Sum all to get A result.&lt;/P&gt;</description>
    <pubDate>Fri, 17 May 2024 09:34:46 GMT</pubDate>
    <dc:creator>tnunes</dc:creator>
    <dc:date>2024-05-17T09:34:46Z</dc:date>
    <item>
      <title>Sum deeper than filter</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-deeper-than-filter/m-p/2453410#M98173</link>
      <description>&lt;P&gt;Hi community,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to create a sum with a specific critéria.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table example:&lt;/P&gt;
&lt;P&gt;A | B | C | D&lt;/P&gt;
&lt;P&gt;1 | 1 | 4 | 3&lt;/P&gt;
&lt;P&gt;1 | 2 | 7 | 2&lt;/P&gt;
&lt;P&gt;1 | 3 | 7 | 20&lt;/P&gt;
&lt;P&gt;Result needed:&lt;/P&gt;
&lt;P&gt;A | R&lt;/P&gt;
&lt;P&gt;1 | 6&lt;/P&gt;
&lt;P&gt;Result is calculated with the following condition: if (C-D &amp;gt; 0) then C-D else 0, so the "aux" table should be :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A | B | C - D with condition&lt;/P&gt;
&lt;P&gt;1 | 1 | 1&lt;/P&gt;
&lt;P&gt;1 | 2 | 5&lt;/P&gt;
&lt;P&gt;1 | 3 | 0&lt;/P&gt;
&lt;P&gt;And I need to sum.&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 22:43:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-deeper-than-filter/m-p/2453410#M98173</guid>
      <dc:creator>tnunes</dc:creator>
      <dc:date>2024-05-16T22:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Sum deeper than filter</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-deeper-than-filter/m-p/2453413#M98174</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/180330"&gt;@tnunes&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;does your test&amp;nbsp;&lt;SPAN&gt;if (C-D &amp;gt; 0) then C-D else 0 have to be done on each row level separatelly?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If yes - your bet is to do it in load script during data load as that will yield much better performance:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If(C-D &amp;gt; 0, C-D, 0) as E&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;then in UI you just do Sum(E)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 23:38:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-deeper-than-filter/m-p/2453413#M98174</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2024-05-16T23:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Sum deeper than filter</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-deeper-than-filter/m-p/2453430#M98177</link>
      <description>&lt;P&gt;Hello&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.qlik.com/t5/user/viewprofilepage/user-id/180330" target="_blank" rel="noopener"&gt;@tnunes&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Result needed:&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TauseefKhan_0-1715917627260.png" style="width: 240px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/166277i7E87AC79AD6C02C2/image-dimensions/240x102?v=v2" width="240" height="102" role="button" title="TauseefKhan_0-1715917627260.png" alt="TauseefKhan_0-1715917627260.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Script:&lt;/P&gt;
&lt;P&gt;Table:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;A, B, C, D&lt;BR /&gt;1, 1, 4, 3&lt;BR /&gt;1, 2, 7, 2&lt;BR /&gt;1, 3, 7, 20&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;// Create calculated column&lt;BR /&gt;TempTable:&lt;BR /&gt;LOAD *,&lt;BR /&gt;If(C-D &amp;gt; 0, C-D, 0) as [C-D_with_condition]&lt;BR /&gt;RESIDENT Table;&lt;/P&gt;
&lt;P&gt;// Create new table with calculated column&lt;BR /&gt;ResultTable:&lt;BR /&gt;LOAD A,&lt;BR /&gt;Sum([C-D_with_condition]) as R&lt;BR /&gt;RESIDENT TempTable&lt;BR /&gt;GROUP BY A;&lt;BR /&gt;&lt;BR /&gt;**If the Above solution is&amp;nbsp;&lt;SPAN&gt;correct/appropriate replies as "solution". Please LIKE threads if the provided solution is helpful to.**&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 04:04:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-deeper-than-filter/m-p/2453430#M98177</guid>
      <dc:creator>TauseefKhan</dc:creator>
      <dc:date>2024-05-17T04:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Sum deeper than filter</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-deeper-than-filter/m-p/2453436#M98179</link>
      <description>&lt;P&gt;An alternative to the if() statement suggested by others is to use rangemax(), like this.&lt;/P&gt;
&lt;P&gt;Table:&lt;/P&gt;
&lt;P&gt;LOAD *, rangemax(C-D, 0) as R INLINE [&lt;/P&gt;
&lt;P&gt;A, B, C, D&lt;/P&gt;
&lt;P&gt;1, 1, 4, 3&lt;/P&gt;
&lt;P&gt;1, 2, 7, 2&lt;/P&gt;
&lt;P&gt;1, 3, 7, 20&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 04:44:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-deeper-than-filter/m-p/2453436#M98179</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2024-05-17T04:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sum deeper than filter</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-deeper-than-filter/m-p/2453564#M98192</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for all the replies.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think using this in data load I will not have the result that I want since it depends on all filters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to use something like "Sum(Aggr(Sum()))" , so Sum all the C-D, agreggate and Sum all to get A result.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 09:34:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-deeper-than-filter/m-p/2453564#M98192</guid>
      <dc:creator>tnunes</dc:creator>
      <dc:date>2024-05-17T09:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Sum deeper than filter</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-deeper-than-filter/m-p/2453766#M98205</link>
      <description>&lt;P&gt;Load * inline [&lt;BR /&gt;A | B | C | D&lt;/P&gt;
&lt;P&gt;1 | 1 | 4 | 3&lt;/P&gt;
&lt;P&gt;1 | 2 | 7 | 2&lt;/P&gt;
&lt;P&gt;1 | 3 | 7 | 20] (delimiter is '|');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Measure would be:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sum((C-D)*fabs(C&amp;gt;D))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-05-17 at 22.10.16.png" style="width: 994px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/166356i8A1AA79426D6DC20/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-05-17 at 22.10.16.png" alt="Screenshot 2024-05-17 at 22.10.16.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 16:43:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-deeper-than-filter/m-p/2453766#M98205</guid>
      <dc:creator>Firefly_cam</dc:creator>
      <dc:date>2024-05-17T16:43:25Z</dc:date>
    </item>
  </channel>
</rss>

