<?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 Aggregated function within Set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggregated-function-within-Set-analysis/m-p/688137#M249249</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my fact is as followed:&lt;/P&gt;&lt;P&gt;empID, LineID,YearMonthPaid,YearMonthValue,Amount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wish to show case all employees who were paid less a specified amount. the user will input the amount into the variable &lt;STRONG&gt;vMinAmount&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;usually i would create an aggr() expression in the dimension and use the suppress null values. however this a very expensive operation and for a large data set takes too long or doesn't work at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(aggr(sum(Amount),empID,YearMonthPaid)&amp;lt;$(vMinAmount),empID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I have seen in one of the posts that there is a possibility to put the condition inside set analysis and use up less system resources, I have written the following expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Amount={"=Sum(Amount)&amp;lt;$(vMinAmount)"}&amp;gt;}Amount) and the dimensions in the chart are: empID, YearMonthPaid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;an employee can have more than one payment on the same YearMonthPaid, I am interested in the sum of all lines and not each one apart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, this expression showד results, however it is the same as writing: Sum({$&amp;lt;Amount={"&amp;lt;$(vMinAmount)"}&amp;gt;}Amount)&lt;/P&gt;&lt;P&gt;There is no aggregation happening, so if an employee have 2 lines and I wish to view all the employees with less than a 1000, for employee 111 (following example) i am not supposed to get any results (since he received 1560 in total), however I get the first line and amount is -440.&lt;/P&gt;&lt;P&gt;&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;&lt;STRONG&gt;EmpID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;YearMonthPaid&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;YearMonthValue&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;111&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2014-06&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2014-06&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-440&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;2014-06&lt;/TD&gt;&lt;TD&gt;2014-05&lt;/TD&gt;&lt;TD&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to accomplish this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Jul 2014 12:09:47 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-07-01T12:09:47Z</dc:date>
    <item>
      <title>Aggregated function within Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregated-function-within-Set-analysis/m-p/688137#M249249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my fact is as followed:&lt;/P&gt;&lt;P&gt;empID, LineID,YearMonthPaid,YearMonthValue,Amount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wish to show case all employees who were paid less a specified amount. the user will input the amount into the variable &lt;STRONG&gt;vMinAmount&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;usually i would create an aggr() expression in the dimension and use the suppress null values. however this a very expensive operation and for a large data set takes too long or doesn't work at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(aggr(sum(Amount),empID,YearMonthPaid)&amp;lt;$(vMinAmount),empID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I have seen in one of the posts that there is a possibility to put the condition inside set analysis and use up less system resources, I have written the following expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Amount={"=Sum(Amount)&amp;lt;$(vMinAmount)"}&amp;gt;}Amount) and the dimensions in the chart are: empID, YearMonthPaid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;an employee can have more than one payment on the same YearMonthPaid, I am interested in the sum of all lines and not each one apart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, this expression showד results, however it is the same as writing: Sum({$&amp;lt;Amount={"&amp;lt;$(vMinAmount)"}&amp;gt;}Amount)&lt;/P&gt;&lt;P&gt;There is no aggregation happening, so if an employee have 2 lines and I wish to view all the employees with less than a 1000, for employee 111 (following example) i am not supposed to get any results (since he received 1560 in total), however I get the first line and amount is -440.&lt;/P&gt;&lt;P&gt;&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;&lt;STRONG&gt;EmpID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;YearMonthPaid&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;YearMonthValue&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Amount&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;111&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2014-06&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2014-06&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-440&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;2014-06&lt;/TD&gt;&lt;TD&gt;2014-05&lt;/TD&gt;&lt;TD&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to accomplish this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 12:09:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregated-function-within-Set-analysis/m-p/688137#M249249</guid>
      <dc:creator />
      <dc:date>2014-07-01T12:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregated function within Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregated-function-within-Set-analysis/m-p/688138#M249250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all, give the help page for Set Analysis a thorough read, it is a good overview of the feature.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To achieve your requirement you need to make your set based on the employee, not the amount, Like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;sum(&lt;/SPAN&gt; {$&amp;lt;EmpID = {“=Sum(Amount) &amp;lt; $(vMinAmount)”}&amp;gt;} Amount &lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 12:29:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregated-function-within-Set-analysis/m-p/688138#M249250</guid>
      <dc:creator>chriscammers</dc:creator>
      <dc:date>2014-07-01T12:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregated function within Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregated-function-within-Set-analysis/m-p/688139#M249251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks! works great. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have seen just one example of using aggregate function within a set analysis expression, I personally believe that set analysis is preferable to using an if statement, where ever possible. every time I use set analysis instead of IF, it speeds up calculation, especially noticeable with&amp;nbsp; large data sets. however, usually most posts refer to a IF+aggr() combination which I am happy to replace, if I can, especially with an external parameter. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which help page did you refer to?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 13:17:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregated-function-within-Set-analysis/m-p/688139#M249251</guid>
      <dc:creator />
      <dc:date>2014-07-01T13:17:27Z</dc:date>
    </item>
  </channel>
</rss>

