<?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: Set Analysis - Group By in Where Clause in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Group-By-in-Where-Clause/m-p/1671960#M50826</link>
    <description>&lt;P&gt;This may work:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count({&amp;lt;customer = {"$(payment_date &amp;gt;= '01/01/2018' and payment_date &amp;lt;='31/12/2018'"}&amp;gt;} distinct customer)&lt;/LI-CODE&gt;&lt;P&gt;Or this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count({&amp;lt;customer = P({&amp;lt;payment_date ={&amp;gt;='01/01/2018' &amp;lt;='31/12/2018'}&amp;gt;})&amp;gt;} distinct customer)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;(depends on your actual data model)&lt;/P&gt;</description>
    <pubDate>Tue, 04 Feb 2020 06:12:27 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2020-02-04T06:12:27Z</dc:date>
    <item>
      <title>Set Analysis - Group By in Where Clause</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Group-By-in-Where-Clause/m-p/1671958#M50824</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I am trying to write Set Analysis to do the following:&lt;/P&gt;&lt;P&gt;Count&amp;nbsp; distinct customers&amp;nbsp;from sales transactions for a particular date range that have total sales &amp;lt;&amp;gt; 0&lt;/P&gt;&lt;P&gt;SQL would look something like this..&lt;/P&gt;&lt;P&gt;Select distinct customer from table where (select customer, Sum(sales) from table where payment date &amp;gt;=01/01/2018 and &amp;lt;=31/12/2018 Group by customer);&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 21:38:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Group-By-in-Where-Clause/m-p/1671958#M50824</guid>
      <dc:creator>kcville</dc:creator>
      <dc:date>2021-12-20T21:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Group By in Where Clause</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Group-By-in-Where-Clause/m-p/1671960#M50826</link>
      <description>&lt;P&gt;This may work:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count({&amp;lt;customer = {"$(payment_date &amp;gt;= '01/01/2018' and payment_date &amp;lt;='31/12/2018'"}&amp;gt;} distinct customer)&lt;/LI-CODE&gt;&lt;P&gt;Or this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count({&amp;lt;customer = P({&amp;lt;payment_date ={&amp;gt;='01/01/2018' &amp;lt;='31/12/2018'}&amp;gt;})&amp;gt;} distinct customer)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;(depends on your actual data model)&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 06:12:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Group-By-in-Where-Clause/m-p/1671960#M50826</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2020-02-04T06:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Group By in Where Clause</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Group-By-in-Where-Clause/m-p/1671961#M50827</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;try this&amp;nbsp;&lt;/P&gt;&lt;P&gt;Count(Distinct {&amp;lt;&lt;SPAN&gt;payment date&lt;/SPAN&gt;={"&amp;gt;=01/01/2009 and &amp;lt;=01/09/2009"}&amp;gt;}CustomerID)&amp;nbsp;&lt;/P&gt;&lt;P&gt;if this is showing 0 values and Counting them then try this&lt;/P&gt;&lt;P&gt;Count(Distinct {&amp;lt;&lt;SPAN&gt;payment date&lt;/SPAN&gt;={"&amp;gt;=01/01/2009 and &amp;lt;=01/09/2009"},0={"&amp;gt;$(=Aggr(Sum(sales),CustomerID))"}&amp;gt;}CustomerID)&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 06:14:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Group-By-in-Where-Clause/m-p/1671961#M50827</guid>
      <dc:creator>Kashyap_R</dc:creator>
      <dc:date>2020-02-04T06:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Group By in Where Clause</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Group-By-in-Where-Clause/m-p/1672746#M50928</link>
      <description>&lt;P&gt;Thank you for your replies, however these are not working.&lt;/P&gt;&lt;P&gt;I really need to select the date cohort first and then check for aggregate sum greater than 0.&lt;/P&gt;&lt;P&gt;something like this..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If(payment_date &amp;gt;='01/01/2018' and &amp;lt;'31/12/2019', Count({$&amp;lt;customer={"=aggr(Sum(payment),customer) &amp;gt; 0"}&amp;gt;}distinct customer)&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 01:21:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Group-By-in-Where-Clause/m-p/1672746#M50928</guid>
      <dc:creator>kcville</dc:creator>
      <dc:date>2020-02-06T01:21:35Z</dc:date>
    </item>
  </channel>
</rss>

