<?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 Need help using set analysis with aggr in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-help-using-set-analysis-with-aggr/m-p/197634#M502919</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Jesper,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt;Have u found asolution to this problem?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt;I have a similar problem using set analysis inside aggr.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt;Trying to calculate:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt;Avg(aggr(count({$&amp;lt;DATE= {“&amp;gt;=$(DinamicDate)”}&amp;gt;} distinct Customers),DATE))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt;Where DinamicDate= DATE-3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt;Actually If I Select one day, I want to count the number of customers in the last 3 days.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt;If I Selectmore than one Date I want the avg of that count aggr by date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt;Thanks for any &lt;/SPAN&gt;help..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jul 2011 11:56:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-07-21T11:56:38Z</dc:date>
    <item>
      <title>Need help using set analysis with aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-using-set-analysis-with-aggr/m-p/197629#M502910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have encountered a problem when using set analysis within an aggr() function. I have two tables:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Data - containing the fields StoreNo, Month, Sales.&lt;/LI&gt;&lt;LI&gt;Focus - containing the fields StoreNo, focusmonth&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;What I want to do is sum up the sales per store and month, but only for the distinct store and month specified in my table named Focus.&lt;/P&gt;&lt;P&gt;Using the good old &lt;B&gt;Sum(Aggr(distinct Sum(If(Month = focusmonth, Sales)),Store,Month))&lt;/B&gt; does solve my problem in my small example, but I want to do the same thing using Set-Analysis which - in my head atleast - shouldn't pose a problem. But it does.&lt;/P&gt;&lt;P&gt;Using the expression &lt;B&gt;Sum(Aggr(distinct Sum({$&amp;lt;Month = {$(=Only(focusmonth))}&amp;gt;} Sales),Store,Month))&lt;/B&gt; gives me a zero value.&lt;/P&gt;&lt;P&gt;I've attached an example of this containing 6 rows. Considering that the data I want to use this expression on weighs in at about 70 million rows I'm not sure that the If-statement will be a very practical one.&lt;/P&gt;&lt;P&gt;Does anyone have any bright ideas? Have I missed something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/cheers!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Mar 2010 14:17:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-using-set-analysis-with-aggr/m-p/197629#M502910</guid>
      <dc:creator>jesper_bagge</dc:creator>
      <dc:date>2010-03-30T14:17:52Z</dc:date>
    </item>
    <item>
      <title>Need help using set analysis with aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-using-set-analysis-with-aggr/m-p/197630#M502912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jesper,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add the set analysis statement to the first Sum as well as the second&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Month = {$(=Only(focusmonth))}&amp;gt;} Aggr(distinct Sum({$&amp;lt;Month = {$(=Only(focusmonth))}&amp;gt;} Sales),Store,Month))&lt;/P&gt;&lt;P&gt;This will work when you have one focus month selected.&lt;/P&gt;&lt;P&gt;/Johan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Mar 2010 14:43:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-using-set-analysis-with-aggr/m-p/197630#M502912</guid>
      <dc:creator />
      <dc:date>2010-03-30T14:43:49Z</dc:date>
    </item>
    <item>
      <title>Need help using set analysis with aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-using-set-analysis-with-aggr/m-p/197631#M502914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Johan,&lt;/P&gt;&lt;P&gt;If I select one focus month, I don't even have to add the set-statement to the first sum.&lt;/P&gt;&lt;P&gt;However, this doesn't solve my problem. I will have approximately 20000 variants of these focus months in my live data and selecting one at a time isn't a viable option &lt;IMG alt="Wink" src="http://community.qlik.com/emoticons/emotion-5.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Mar 2010 14:52:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-using-set-analysis-with-aggr/m-p/197631#M502914</guid>
      <dc:creator>jesper_bagge</dc:creator>
      <dc:date>2010-03-30T14:52:37Z</dc:date>
    </item>
    <item>
      <title>Need help using set analysis with aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-using-set-analysis-with-aggr/m-p/197632#M502915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The way you have written the set analysis statement, using the only function, requires you to have one focus month selected. I'm not sure you can get the desired results using set analysis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Mar 2010 15:01:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-using-set-analysis-with-aggr/m-p/197632#M502915</guid>
      <dc:creator />
      <dc:date>2010-03-30T15:01:34Z</dc:date>
    </item>
    <item>
      <title>Need help using set analysis with aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-using-set-analysis-with-aggr/m-p/197633#M502918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Johan,&lt;/P&gt;&lt;P&gt;The If-statement also uses an only-function, and should only work with one focus month selected. But since I use it within an aggr, only one possible month exists for every StoreNo. Thats the beauty of the Aggr function.&lt;/P&gt;&lt;P&gt;So, still at square one. It works with a regular If-statement, but not using the same logic in a set-statement.&lt;/P&gt;&lt;P&gt;Anyone else have any input on this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Mar 2010 17:23:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-using-set-analysis-with-aggr/m-p/197633#M502918</guid>
      <dc:creator>jesper_bagge</dc:creator>
      <dc:date>2010-03-30T17:23:21Z</dc:date>
    </item>
    <item>
      <title>Need help using set analysis with aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-using-set-analysis-with-aggr/m-p/197634#M502919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Jesper,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt;Have u found asolution to this problem?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt;I have a similar problem using set analysis inside aggr.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt;Trying to calculate:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt;Avg(aggr(count({$&amp;lt;DATE= {“&amp;gt;=$(DinamicDate)”}&amp;gt;} distinct Customers),DATE))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt;Where DinamicDate= DATE-3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt;Actually If I Select one day, I want to count the number of customers in the last 3 days.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt;If I Selectmore than one Date I want the avg of that count aggr by date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 9pt; font-family: Arial, sans-serif;"&gt;Thanks for any &lt;/SPAN&gt;help..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 11:56:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-using-set-analysis-with-aggr/m-p/197634#M502919</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-21T11:56:38Z</dc:date>
    </item>
  </channel>
</rss>

