<?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 Set Expression: Filter by conditional aggregate in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Expression-Filter-by-conditional-aggregate/m-p/2153058#M93395</link>
    <description>&lt;P&gt;I have data in this shape:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 195pt;" border="0" width="258px" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" style="height: 16.0pt; width: 65pt;"&gt;Id&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px" style="width: 65pt;"&gt;metric&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" style="width: 65pt;"&gt;revenue&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" align="right" style="height: 16.0pt;"&gt;1&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px"&gt;gross&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" align="right"&gt;23&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" align="right" style="height: 16.0pt;"&gt;1&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px"&gt;net&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" align="right"&gt;15&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" align="right" style="height: 16.0pt;"&gt;2&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px"&gt;gross&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" align="right"&gt;45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" align="right" style="height: 16.0pt;"&gt;2&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px"&gt;net&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" align="right"&gt;12&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" align="right" style="height: 16.0pt;"&gt;3&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px"&gt;gross&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" align="right"&gt;78&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" align="right" style="height: 16.0pt;"&gt;3&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px"&gt;net&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" align="right"&gt;34&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" align="right" style="height: 16.0pt;"&gt;4&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px"&gt;gross&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" align="right"&gt;89&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" align="right" style="height: 16.0pt;"&gt;4&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px"&gt;net&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" align="right"&gt;25&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I need is the distinct numbers of Ids where gross revenue is &amp;gt;20 as a chart formula.&lt;BR /&gt;&lt;BR /&gt;Basically this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count(Distinct {&amp;lt;[Id]={"=Sum({&amp;lt;metric={gross}&amp;gt;} revenue)&amp;gt;=20"} &amp;gt;} Id)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;which doesn't work of course.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any help would be greatly appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2023 13:19:28 GMT</pubDate>
    <dc:creator>Kellerassel</dc:creator>
    <dc:date>2023-12-14T13:19:28Z</dc:date>
    <item>
      <title>Set Expression: Filter by conditional aggregate</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Expression-Filter-by-conditional-aggregate/m-p/2153058#M93395</link>
      <description>&lt;P&gt;I have data in this shape:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 195pt;" border="0" width="258px" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" style="height: 16.0pt; width: 65pt;"&gt;Id&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px" style="width: 65pt;"&gt;metric&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" style="width: 65pt;"&gt;revenue&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" align="right" style="height: 16.0pt;"&gt;1&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px"&gt;gross&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" align="right"&gt;23&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" align="right" style="height: 16.0pt;"&gt;1&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px"&gt;net&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" align="right"&gt;15&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" align="right" style="height: 16.0pt;"&gt;2&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px"&gt;gross&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" align="right"&gt;45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" align="right" style="height: 16.0pt;"&gt;2&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px"&gt;net&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" align="right"&gt;12&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" align="right" style="height: 16.0pt;"&gt;3&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px"&gt;gross&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" align="right"&gt;78&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" align="right" style="height: 16.0pt;"&gt;3&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px"&gt;net&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" align="right"&gt;34&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" align="right" style="height: 16.0pt;"&gt;4&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px"&gt;gross&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" align="right"&gt;89&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD width="86.2031px" height="16px" align="right" style="height: 16.0pt;"&gt;4&lt;/TD&gt;
&lt;TD width="86.3438px" height="16px"&gt;net&lt;/TD&gt;
&lt;TD width="86.4531px" height="16px" align="right"&gt;25&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I need is the distinct numbers of Ids where gross revenue is &amp;gt;20 as a chart formula.&lt;BR /&gt;&lt;BR /&gt;Basically this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count(Distinct {&amp;lt;[Id]={"=Sum({&amp;lt;metric={gross}&amp;gt;} revenue)&amp;gt;=20"} &amp;gt;} Id)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;which doesn't work of course.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 13:19:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Expression-Filter-by-conditional-aggregate/m-p/2153058#M93395</guid>
      <dc:creator>Kellerassel</dc:creator>
      <dc:date>2023-12-14T13:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression: Filter by conditional aggregate</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Expression-Filter-by-conditional-aggregate/m-p/2153392#M93419</link>
      <description>&lt;P&gt;This does the job using an If()-statement instead of a set expression.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count(Distinct If(Aggr(Sum({&amp;lt;metric={'gross'}&amp;gt;} revenue), Id) &amp;gt; 20, Id))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;But maybe there is a more performant solution inside set expression&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 07:37:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Expression-Filter-by-conditional-aggregate/m-p/2153392#M93419</guid>
      <dc:creator>Kellerassel</dc:creator>
      <dc:date>2023-12-15T07:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression: Filter by conditional aggregate</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Expression-Filter-by-conditional-aggregate/m-p/2153452#M93424</link>
      <description>&lt;P&gt;The first expression should work and be more performant, what was the issue with it?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 08:54:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Expression-Filter-by-conditional-aggregate/m-p/2153452#M93424</guid>
      <dc:creator>vincent_ardiet_</dc:creator>
      <dc:date>2023-12-15T08:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression: Filter by conditional aggregate</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Expression-Filter-by-conditional-aggregate/m-p/2153466#M93425</link>
      <description>&lt;P&gt;Not sure why you are using SUM here ...?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;try this whether it works&lt;/P&gt;
&lt;P&gt;Count(Distinct{&amp;lt;[revenue]={"&amp;gt;20"}&amp;gt;}Id)&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 09:06:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Expression-Filter-by-conditional-aggregate/m-p/2153466#M93425</guid>
      <dc:creator>rajjul</dc:creator>
      <dc:date>2023-12-15T09:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Set Expression: Filter by conditional aggregate</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Expression-Filter-by-conditional-aggregate/m-p/2153468#M93426</link>
      <description>&lt;P&gt;Now I am utterly confused.. Yes, it does work. Now! I have no clue why it didn't work yesterday.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 09:21:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Expression-Filter-by-conditional-aggregate/m-p/2153468#M93426</guid>
      <dc:creator>Kellerassel</dc:creator>
      <dc:date>2023-12-15T09:21:01Z</dc:date>
    </item>
  </channel>
</rss>

