<?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: Total sum of category link to another one in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Total-sum-of-category-link-to-another-one/m-p/2527070#M107331</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;In order to avoid the nested aggregation error, change the order of your functions. Both IF and the result should be inside of your aggr:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sum(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;AGGR(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If(Count(DISTINCT {&amp;lt;ProductCategory={410}&amp;gt;} OrderID), OrderID) &amp;gt; 0, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Sum({&amp;lt;ProductCategory={411, 442, 452}&amp;gt;} Sales), 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This formula can get quite heavy though, I'd try to replace it with advanced Set Analysis:&lt;BR /&gt;&lt;BR /&gt;Sum({&amp;lt;ProductCategory={411, 442, 452}, OrderID=P(&amp;lt;{&amp;lt;ProductCategory={410}&amp;gt;}&amp;nbsp; )&amp;gt;} Sales)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This formula should return sum of Sales for the three categories for Orders that are available with the Product Category = 410. I think it should work better for you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Allow me to invite you to my Qlik Expert Class that I'll be teaching in Vienna, Austria on September 22-24. I will be teaching advanced data modeling, advanced scripting, performance optimization, and advanced aggregation and Set Analysis techniques that cover some of these challenges. You will learn the most advanced Qlik methodologies that will help you solve tough problems like this one.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Aug 2025 13:53:55 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2025-08-12T13:53:55Z</dc:date>
    <item>
      <title>Total sum of category link to another one</title>
      <link>https://community.qlik.com/t5/App-Development/Total-sum-of-category-link-to-another-one/m-p/2527064#M107330</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I would like to create a mesure that sum the sales for 3 ProductCategories if my order have the productcatgorie = 410.&lt;/P&gt;
&lt;P&gt;I have try this :&lt;/P&gt;
&lt;P&gt;&lt;CODE class="language-plaintext"&gt;&lt;SPAN&gt;Sum(If(Aggr(Count(DISTINCT {&amp;lt;ProductCategory={410}&amp;gt;} OrderID), OrderID) &amp;gt; 0,
&lt;/SPAN&gt;    Sum({&amp;lt;&lt;SPAN&gt;ProductCategory&lt;/SPAN&gt;={411, 442, 452}&amp;gt;} Sales), 0))&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;I had this error :&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;nested aggregation not allowed&lt;BR /&gt;&lt;BR /&gt;Then I try with a variable that get all orderID with the Category 410.&amp;nbsp;&lt;BR /&gt;And try this :&lt;BR /&gt;Sum(If(WildMatch(&lt;CODE class="language-plaintext"&gt;&lt;SPAN&gt;OrderID&lt;/SPAN&gt;&lt;/CODE&gt;, '$(vFact410)'),&lt;BR /&gt;If(Match(&lt;CODE class="language-plaintext"&gt;&lt;SPAN&gt;ProductCategory&lt;/SPAN&gt;&lt;/CODE&gt;, 411, 442, 452), Sales, 0), 0))&lt;BR /&gt;&lt;BR /&gt;But it didn't work and show 0 for each orderlineID.&lt;BR /&gt;&lt;BR /&gt;The Category are link to the orderdetail, with many lines that have a category.&lt;BR /&gt;Should I take orderlineID instead of orderID ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Hope my request is clear, many thanks for your help&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="flex min-h-8 flex-row items-center justify-between py-1 font-normal opacity-0 transition-opacity duration-500 ease-in-out group-hover:opacity-100 ms-auto mb-2 w-fit max-w-full gap-3"&gt;
&lt;DIV class="flex flex-row items-center gap-2"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="flex flex-row items-center gap-2"&gt;
&lt;DIV class="text-sm text-hint" data-state="closed"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 12 Aug 2025 13:42:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Total-sum-of-category-link-to-another-one/m-p/2527064#M107330</guid>
      <dc:creator>Tenuki</dc:creator>
      <dc:date>2025-08-12T13:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Total sum of category link to another one</title>
      <link>https://community.qlik.com/t5/App-Development/Total-sum-of-category-link-to-another-one/m-p/2527070#M107331</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;In order to avoid the nested aggregation error, change the order of your functions. Both IF and the result should be inside of your aggr:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sum(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;AGGR(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If(Count(DISTINCT {&amp;lt;ProductCategory={410}&amp;gt;} OrderID), OrderID) &amp;gt; 0, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Sum({&amp;lt;ProductCategory={411, 442, 452}&amp;gt;} Sales), 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This formula can get quite heavy though, I'd try to replace it with advanced Set Analysis:&lt;BR /&gt;&lt;BR /&gt;Sum({&amp;lt;ProductCategory={411, 442, 452}, OrderID=P(&amp;lt;{&amp;lt;ProductCategory={410}&amp;gt;}&amp;nbsp; )&amp;gt;} Sales)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This formula should return sum of Sales for the three categories for Orders that are available with the Product Category = 410. I think it should work better for you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Allow me to invite you to my Qlik Expert Class that I'll be teaching in Vienna, Austria on September 22-24. I will be teaching advanced data modeling, advanced scripting, performance optimization, and advanced aggregation and Set Analysis techniques that cover some of these challenges. You will learn the most advanced Qlik methodologies that will help you solve tough problems like this one.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2025 13:53:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Total-sum-of-category-link-to-another-one/m-p/2527070#M107331</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2025-08-12T13:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Total sum of category link to another one</title>
      <link>https://community.qlik.com/t5/App-Development/Total-sum-of-category-link-to-another-one/m-p/2527075#M107332</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6152"&gt;@Oleg_Troyansky&lt;/a&gt;&amp;nbsp;many thanks for your quick answer.&lt;/P&gt;
&lt;P&gt;The first mesure didn't work, I don't know why. Second one work, but I need to check if the sum match my data.&lt;BR /&gt;&lt;BR /&gt;I will ask my manager for the invitation, thank you.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2025 14:16:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Total-sum-of-category-link-to-another-one/m-p/2527075#M107332</guid>
      <dc:creator>Tenuki</dc:creator>
      <dc:date>2025-08-12T14:16:29Z</dc:date>
    </item>
  </channel>
</rss>

