<?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 Group By - with an added condition in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Group-By-with-an-added-condition/m-p/2485143#M101233</link>
    <description>&lt;P&gt;````&lt;/P&gt;
&lt;P&gt;Dummy:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Customer, Sales, Flag&lt;BR /&gt;&amp;nbsp; &amp;nbsp; A, 100, 2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; A, 150, 2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; A, 300, 0&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; B, 50, 3&lt;BR /&gt;&amp;nbsp; &amp;nbsp; B, 100, 2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; B, 30, 1&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;```&lt;/P&gt;
&lt;P&gt;Hi, I want to &lt;STRONG&gt;group&lt;/STRONG&gt; this dummy data &lt;STRONG&gt;by customer&lt;/STRONG&gt;, but with the condition to sum just &lt;STRONG&gt;register where each customer Flag has is top value.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;So for customer &lt;U&gt;A registers&lt;/U&gt; must sum only &lt;U&gt;where Flag = 2&lt;/U&gt; and for customer &lt;U&gt;B registers&lt;/U&gt; where &lt;U&gt;Flag = 3&lt;/U&gt;.&lt;/P&gt;
&lt;P&gt;is there any way to do it dynamically?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;```&lt;/P&gt;
&lt;P&gt;// Dummy table solution&lt;/P&gt;
&lt;P&gt;// A, 250, 2&lt;BR /&gt;// B, 50, 3&lt;/P&gt;
&lt;P&gt;```&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Oct 2024 15:08:48 GMT</pubDate>
    <dc:creator>adecora</dc:creator>
    <dc:date>2024-10-03T15:08:48Z</dc:date>
    <item>
      <title>Group By - with an added condition</title>
      <link>https://community.qlik.com/t5/App-Development/Group-By-with-an-added-condition/m-p/2485143#M101233</link>
      <description>&lt;P&gt;````&lt;/P&gt;
&lt;P&gt;Dummy:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Customer, Sales, Flag&lt;BR /&gt;&amp;nbsp; &amp;nbsp; A, 100, 2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; A, 150, 2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; A, 300, 0&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; B, 50, 3&lt;BR /&gt;&amp;nbsp; &amp;nbsp; B, 100, 2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; B, 30, 1&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;```&lt;/P&gt;
&lt;P&gt;Hi, I want to &lt;STRONG&gt;group&lt;/STRONG&gt; this dummy data &lt;STRONG&gt;by customer&lt;/STRONG&gt;, but with the condition to sum just &lt;STRONG&gt;register where each customer Flag has is top value.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;So for customer &lt;U&gt;A registers&lt;/U&gt; must sum only &lt;U&gt;where Flag = 2&lt;/U&gt; and for customer &lt;U&gt;B registers&lt;/U&gt; where &lt;U&gt;Flag = 3&lt;/U&gt;.&lt;/P&gt;
&lt;P&gt;is there any way to do it dynamically?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;```&lt;/P&gt;
&lt;P&gt;// Dummy table solution&lt;/P&gt;
&lt;P&gt;// A, 250, 2&lt;BR /&gt;// B, 50, 3&lt;/P&gt;
&lt;P&gt;```&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2024 15:08:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Group-By-with-an-added-condition/m-p/2485143#M101233</guid>
      <dc:creator>adecora</dc:creator>
      <dc:date>2024-10-03T15:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Group By - with an added condition</title>
      <link>https://community.qlik.com/t5/App-Development/Group-By-with-an-added-condition/m-p/2485156#M101234</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/154293"&gt;@adecora&lt;/a&gt;&amp;nbsp; try below&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Data:
LOAD * INLINE [
    Customer, Sales, Flag
    A, 100, 2
    A, 150, 2
    A, 300, 0 
    B, 50, 3
    B, 100, 2
    B, 30, 1
];

Inner Join(Data)
Load Customer,
     max(Flag) as Flag
Resident Data
Group by Customer;

Final:
load Customer, 
     sum(Sales) as Sales
Resident Data
Group by Customer;

Drop Table Data;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2024 15:48:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Group-By-with-an-added-condition/m-p/2485156#M101234</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2024-10-03T15:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Group By - with an added condition</title>
      <link>https://community.qlik.com/t5/App-Development/Group-By-with-an-added-condition/m-p/2485301#M101250</link>
      <description>&lt;P&gt;Thanks, this was exactly what i was looking for.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2024 09:28:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Group-By-with-an-added-condition/m-p/2485301#M101250</guid>
      <dc:creator>adecora</dc:creator>
      <dc:date>2024-10-04T09:28:30Z</dc:date>
    </item>
  </channel>
</rss>

