<?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: Using aggr in set analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-aggr-in-set-analysis/m-p/139015#M9761</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This was perfect, thank you very much Andrey!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Oct 2018 19:23:58 GMT</pubDate>
    <dc:creator>elijahabel</dc:creator>
    <dc:date>2018-10-26T19:23:58Z</dc:date>
    <item>
      <title>Using aggr in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Using-aggr-in-set-analysis/m-p/139013#M9759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this problem where I need to be able to use a hierarchy for the visual, and count only the days which have an overall profit. This is in a flat table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if my hierarchy is REGION=&amp;gt;DIVISION, and I have a region selected, next to each division it should show me the number of days where the sum of the revenue is greater than zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an expression, but it is only giving me the number of days greater than zero at the level of hierarchy above what is being displayed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COUNT({&amp;lt;DATE={"=Sum([REVENUE])&amp;gt;0"}&amp;gt;} DISTINCT DATE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All divisions will show as having the same number of Days Up, but after inspection it is clear that this number is coming from the Days Up by Region.&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Hierarchy (DIVISION)&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Days up&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Division A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Division B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Division C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a variable vLevelBelow which properly stores the level of the hierarchy we are currently at (in this case Division), but if I try to aggregate on this within the set analysis, I get all zeroes:&lt;/P&gt;&lt;P&gt;COUNT({&amp;lt;DATE={"=aggr(Sum([REVENUE]),$(=$(vLevelBelow)),DATE)&amp;gt;0"}&amp;gt;} DISTINCT DATE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas? Thanks for all help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Dec 2021 15:42:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-aggr-in-set-analysis/m-p/139013#M9759</guid>
      <dc:creator>elijahabel</dc:creator>
      <dc:date>2021-12-22T15:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using aggr in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Using-aggr-in-set-analysis/m-p/139014#M9760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Elijah. I think set analysis is not appropriate for this issue, since it restricts all data (&lt;SPAN lang="en"&gt;not every row separately&lt;/SPAN&gt;). Try this expression&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;Sum( If(Aggr(Sum(&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;REVENUE&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DATE, DIVISION) &amp;gt; 0, 1&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt; , 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2018 05:12:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-aggr-in-set-analysis/m-p/139014#M9760</guid>
      <dc:creator>andrey_krylov</dc:creator>
      <dc:date>2018-10-26T05:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using aggr in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Using-aggr-in-set-analysis/m-p/139015#M9761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This was perfect, thank you very much Andrey!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2018 19:23:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-aggr-in-set-analysis/m-p/139015#M9761</guid>
      <dc:creator>elijahabel</dc:creator>
      <dc:date>2018-10-26T19:23:58Z</dc:date>
    </item>
  </channel>
</rss>

