<?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: Aggregation Function and Advanced Set Analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1538526#M62652</link>
    <description>&lt;P&gt;inside aggregation function,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&amp;lt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;Year&lt;/SPAN&gt;&lt;SPAN&gt;]=, [&lt;/SPAN&gt;&lt;SPAN&gt;Year&lt;/SPAN&gt;&lt;SPAN&gt;_Num]= {"$(=MAX([&lt;/SPAN&gt;&lt;SPAN&gt;Year&lt;/SPAN&gt;&lt;SPAN&gt;_Num])-1)"}) &amp;gt;} should be within double quotes. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Feb 2019 15:06:47 GMT</pubDate>
    <dc:creator>Vasudha_Manian</dc:creator>
    <dc:date>2019-02-01T15:06:47Z</dc:date>
    <item>
      <title>Aggregation Function and Advanced Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1529714#M62644</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am having a problem when combining the Aggregated function with advanced set analysis. My variable with the set is as follows:&lt;/P&gt;&lt;P&gt;sum(aggr(only(&lt;BR /&gt;{&amp;lt; [Year]=, [Year_Num]= {$(=MAX([Year_Num]))}) &amp;gt;}&lt;BR /&gt;[Price] * [Quantity] * [Exchange Rate])&lt;/P&gt;&lt;P&gt;,[%Order_Number]))&lt;/P&gt;&lt;P&gt;This one works fine. The problem arises when I try to calculate sales for the last year, with the following modifier set:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&amp;lt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;Year&lt;/SPAN&gt;&lt;SPAN&gt;]=, [&lt;/SPAN&gt;&lt;SPAN&gt;Year&lt;/SPAN&gt;&lt;SPAN&gt;_Num]= {$(=MAX([&lt;/SPAN&gt;&lt;SPAN&gt;Year&lt;/SPAN&gt;&lt;SPAN&gt;_Num])-1)}) &amp;gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It doesn't calculate anything just returns cero. If I dont use the Aggregated function the set works just fine (just a simple sum), but when combining the two it doesn't work. I need the aggregated function because products have different attributes in the product master table and so it double counts these and the resulting value is wrong.&amp;nbsp;Using the aggregate and only function prevents this and returns correct numbers&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for the help!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Fermin&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 06:52:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1529714#M62644</guid>
      <dc:creator>Fermin_Takyon</dc:creator>
      <dc:date>2024-11-16T06:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation Function and Advanced Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1529715#M62645</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes you might have to put the set modifier outside just after the sum function as well. Try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sum({&amp;lt; [Year]=, [Year_Num]= {$(=MAX([Year_Num]))}) &amp;gt;}&lt;BR /&gt;SUM(aggr(only(&lt;BR /&gt;{&amp;lt; [Year]=, [Year_Num]= {$(=MAX([Year_Num]))}) &amp;gt;}&lt;BR /&gt;[Price] * [Quantity] * [Exchange Rate]))&lt;/P&gt;&lt;P&gt;,[%Order_Number]))&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jan 2019 19:42:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1529715#M62645</guid>
      <dc:creator>Gabriel</dc:creator>
      <dc:date>2019-01-12T19:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation Function and Advanced Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1529734#M62646</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I try to avoid using aggr unless I have no other option.&lt;/P&gt;&lt;P&gt;I'm unsure why you are getting the double count. Is it because you have two or more products with the same product number in the product table. So its a many to many join with products to orders?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jan 2019 10:21:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1529734#M62646</guid>
      <dc:creator>robert99</dc:creator>
      <dc:date>2019-01-13T10:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation Function and Advanced Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1530215#M62647</link>
      <description>&lt;P&gt;Yes, that is correcto I have a many to many relationship between orders and products, so these double count. Is there a way to eliminate the double counting&amp;nbsp;so as to avoid the use of Aggr which is very resource consuming?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 01:34:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1530215#M62647</guid>
      <dc:creator>Fermin_Takyon</dc:creator>
      <dc:date>2019-01-15T01:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation Function and Advanced Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1530216#M62648</link>
      <description>&lt;P&gt;Thanks!! This works fine! I've tried putting the set analysis&amp;nbsp;in the sum and on the only but not on both. Is there a way to avoid using completely the Aggr and Only function? Because my app is now very slow, there are a lot of calculations and these are just&amp;nbsp;some basic measures&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem with my data model is a many to many relationship product and orders&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 01:36:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1530216#M62648</guid>
      <dc:creator>Fermin_Takyon</dc:creator>
      <dc:date>2019-01-15T01:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation Function and Advanced Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1530300#M62649</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Did you join the products and order table? In other words join to create one table instead of two (in script)? If so don't do this&lt;/P&gt;&lt;P&gt;Because if you say have a table with Product in one column and a sum based on the order column and &lt;STRONG&gt;two separate tables&lt;/STRONG&gt;&amp;nbsp; (Products &amp;amp; Orders) the total will be correct but the rows will not add to the total in some situations&lt;/P&gt;&lt;P&gt;Say if you have&lt;/P&gt;&lt;P&gt;ProdNum&amp;nbsp; ProdName&lt;/P&gt;&lt;P&gt;AAA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AAA Parts&lt;/P&gt;&lt;P&gt;AAA&amp;nbsp;&amp;nbsp;&amp;nbsp; AAA Spares&lt;/P&gt;&lt;P&gt;&amp;nbsp;If your table includes ProdNum not an issue as long as you don't join the tables in script&lt;/P&gt;&lt;P&gt;If your table reports by ProdName there will be double counting as both AAA Parts &amp;amp; AAA Spares will show the same sum. So the total in QLIK will not add to the total of the ProdNames. There are various ways to overcome this depending on various factors. For example one way is just to only load Products numbers once. Using where not exists&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 08:58:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1530300#M62649</guid>
      <dc:creator>robert99</dc:creator>
      <dc:date>2019-01-15T08:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation Function and Advanced Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1530571#M62650</link>
      <description>&lt;P&gt;No am not joining the tables together. In fact I have a link table between them because of different levels of granularity. I cannot load&amp;nbsp;Distinct in the Product table because I will loose information&amp;nbsp;we need to show,&amp;nbsp;because a Product needs to&amp;nbsp;account to two Different Group Products, so when I do both metrics seperately the total is OK.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 16:07:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1530571#M62650</guid>
      <dc:creator>Fermin_Takyon</dc:creator>
      <dc:date>2019-01-15T16:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation Function and Advanced Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1530623#M62651</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I'm not going to be any help. I don't know why you need a link table. Why you need to use aggr. Or why &lt;SPAN&gt;the resulting value is wrong&lt;/SPAN&gt;. But hopefully someone else can help or you can find a solution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 19:04:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1530623#M62651</guid>
      <dc:creator>robert99</dc:creator>
      <dc:date>2019-01-15T19:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation Function and Advanced Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1538526#M62652</link>
      <description>&lt;P&gt;inside aggregation function,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&amp;lt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;Year&lt;/SPAN&gt;&lt;SPAN&gt;]=, [&lt;/SPAN&gt;&lt;SPAN&gt;Year&lt;/SPAN&gt;&lt;SPAN&gt;_Num]= {"$(=MAX([&lt;/SPAN&gt;&lt;SPAN&gt;Year&lt;/SPAN&gt;&lt;SPAN&gt;_Num])-1)"}) &amp;gt;} should be within double quotes. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 15:06:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggregation-Function-and-Advanced-Set-Analysis/m-p/1538526#M62652</guid>
      <dc:creator>Vasudha_Manian</dc:creator>
      <dc:date>2019-02-01T15:06:47Z</dc:date>
    </item>
  </channel>
</rss>

