<?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 on aggr totals in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Analysis-on-aggr-totals/m-p/1445779#M35110</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hmm, i might be mistaken but i'm not sure that its possible,&lt;/P&gt;&lt;P&gt;set analysis is calculated once per the entire object so it is unaware of the dimensions in it, only after the set analysis calculates which rows are possible for the chart, then the object calculates in accordance with the dimension values.&lt;/P&gt;&lt;P&gt;so you will need some form of aggragation in order to make the sum of 100 the limit of each customer and region.&lt;/P&gt;&lt;P&gt;probably the IF is only option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wizardo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 24 Dec 2017 17:23:13 GMT</pubDate>
    <dc:creator>wizardo</dc:creator>
    <dc:date>2017-12-24T17:23:13Z</dc:date>
    <item>
      <title>Set Analysis on aggr totals</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-on-aggr-totals/m-p/1445776#M35107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;I'm trying to see if their is a Set Analysis way to solve the following problem.&amp;nbsp; I used an if statement.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px; text-decoration: underline;"&gt;Problem&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;For each "Customer", show the "Total Revenue" if they have order at least 100 units (Quantity) in all their orders combined.&amp;nbsp; There are multiple orders per customer and I only care if they exceed 100 combined.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;Current Solution&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;if(aggr(sum(Quantity), Customer) &amp;gt; 100, Total Revenue, 0)&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Is there a set analysis way to do this?&amp;nbsp; Should it be done with set analysis?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Dec 2017 00:06:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-on-aggr-totals/m-p/1445776#M35107</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-22T00:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis on aggr totals</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-on-aggr-totals/m-p/1445777#M35108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you want to try this for Revenue: =sum( {$ &amp;lt;Customer={"=sum(Quantity)&amp;gt;100"} &amp;gt;} Revenue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Luis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Dec 2017 01:45:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-on-aggr-totals/m-p/1445777#M35108</guid>
      <dc:creator>luismadriz</dc:creator>
      <dc:date>2017-12-22T01:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis on aggr totals</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-on-aggr-totals/m-p/1445778#M35109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good solution to the problem above. However, in analyzing the data, there was a wrinkle.&amp;nbsp; When I grouped by Region, the filter seemed to apply to the entire data set, rather than being limited to the Customer/Region.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would I solve the following where Region is added to the aggregation using Set Analysis?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;if(aggr(sum(Quantity), Customer, &lt;SPAN style="text-decoration: underline;"&gt;Region&lt;/SPAN&gt;) &amp;gt; 100, Total Revenue, 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Dec 2017 16:28:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-on-aggr-totals/m-p/1445778#M35109</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-22T16:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis on aggr totals</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-on-aggr-totals/m-p/1445779#M35110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hmm, i might be mistaken but i'm not sure that its possible,&lt;/P&gt;&lt;P&gt;set analysis is calculated once per the entire object so it is unaware of the dimensions in it, only after the set analysis calculates which rows are possible for the chart, then the object calculates in accordance with the dimension values.&lt;/P&gt;&lt;P&gt;so you will need some form of aggragation in order to make the sum of 100 the limit of each customer and region.&lt;/P&gt;&lt;P&gt;probably the IF is only option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wizardo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Dec 2017 17:23:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-on-aggr-totals/m-p/1445779#M35110</guid>
      <dc:creator>wizardo</dc:creator>
      <dc:date>2017-12-24T17:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis on aggr totals</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-on-aggr-totals/m-p/1445780#M35111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can make a new field in the script like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Customer,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Region,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AutoNumber(Customer&amp;amp;Region) as CustomerRegionKey&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM ....;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;CustomerRegionKey = {"=Sum(Quantity) &amp;gt; 100"}&amp;gt;}[Total Revenue])&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2017 17:47:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-on-aggr-totals/m-p/1445780#M35111</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-12-25T17:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis on aggr totals</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-on-aggr-totals/m-p/1445781#M35112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm back now. Hope you guys had a nice break!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doug, I've been learning Qlik for the last few months and I'm still struggling but amazed by the power of Qlik associative model, Scripting and Set analysis compared to SQL and other languages... but I'm still struggling:&lt;/P&gt;&lt;P&gt;I put together the following data:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/188182_Untitled.png" style="height: 408px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first thing I would've done is this:&lt;/P&gt;&lt;P&gt;=Sum(IF(AGGR(sum(Orders),Customer,Region)&amp;gt;=100,Revenue)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which got me this:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/188181_Untitled.png" style="height: 420px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which is not correct because is not adding up all the occurrences that I was expecting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This could have been done by using just using &lt;STRONG&gt;Limitations&lt;/STRONG&gt; on the the dimensions based on Sum(Orders) -or Quantity in your design-, but with the inconvenience that it's required to display that measure... so it's sort of like cheating...&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.png" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/188192_Untitled.png" style="height: 236px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, after continuing to struggle for a while I would've gone back to the first document I read on set analysis (attached) to confirm that I needed to find all the members that met the condition which is something like this:&lt;/P&gt;&lt;P&gt;=Sum({&amp;lt;&lt;STRONG style="color: #ff0000;"&gt;Region&amp;amp;Customer&lt;/STRONG&gt; = {"=Sum(Orders)&amp;gt;=100"}&amp;gt;}Revenue)&amp;nbsp;&amp;nbsp;&amp;nbsp; which is not the correct syntax so I needed a new single field that would give me each individual combination of Region and Customer (members)&lt;/P&gt;&lt;P&gt;load *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Region&amp;amp;'-'&amp;amp;Customer as RegionCustomer;&lt;/P&gt;&lt;P&gt;load * inline [&lt;/P&gt;&lt;P&gt;Region,Customer,Orders,Revenue&lt;/P&gt;&lt;P&gt;A,1,20,89&lt;/P&gt;&lt;P&gt;A,2,30,90&lt;/P&gt;&lt;P&gt;A,3,40,91...&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.png" class="image-4 jive-image" src="https://community.qlik.com/legacyfs/online/188193_Untitled.png" style="height: 182px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And of course, instead of wasting performance with that concatenation, the best option is what Sunny proposed!&lt;/P&gt;&lt;P&gt;load *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AutoNumber(Region&amp;amp;'-'&amp;amp;Customer) as RegionCustomerKey;&lt;/P&gt;&lt;P&gt;load * inline [&lt;/P&gt;&lt;P&gt;Region,Customer,Orders,Revenue&lt;/P&gt;&lt;P&gt;A,1,20,89&lt;/P&gt;&lt;P&gt;A,2,30,90&lt;/P&gt;&lt;P&gt;A,3,40,91&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.png" class="image-5 jive-image" src="https://community.qlik.com/legacyfs/online/188194_Untitled.png" style="height: 187px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Luis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2017 00:00:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-on-aggr-totals/m-p/1445781#M35112</guid>
      <dc:creator>luismadriz</dc:creator>
      <dc:date>2017-12-27T00:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis on aggr totals</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-on-aggr-totals/m-p/1445782#M35113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both Luis and Sunny!&amp;nbsp; I really appreciate the time you have taken to give me assistance.&amp;nbsp; For my first question, the effort and feedback provided is amazing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2017 13:48:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-on-aggr-totals/m-p/1445782#M35113</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-27T13:48:43Z</dc:date>
    </item>
  </channel>
</rss>

