<?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: sum of highest sales contributed agent count in backend in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/sum-of-highest-sales-contributed-agent-count-in-backend/m-p/1730637#M55713</link>
    <description>&lt;P&gt;Thanks a lot Kush. Its giving accurate result.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jul 2020 13:00:32 GMT</pubDate>
    <dc:creator>rkpatelqlikview</dc:creator>
    <dc:date>2020-07-24T13:00:32Z</dc:date>
    <item>
      <title>sum of highest sales contributed agent count in backend</title>
      <link>https://community.qlik.com/t5/App-Development/sum-of-highest-sales-contributed-agent-count-in-backend/m-p/1730566#M55704</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Hope you are doing good.&lt;/P&gt;&lt;P&gt;I need some help on below requirement. Please support.&lt;/P&gt;&lt;P&gt;I have Agents and Sales.I need to show the agent count who contributed 70% from total sales.&lt;/P&gt;&lt;P&gt;Example: In below data My total sales for Jan-2020 month 140M from this 70% means 98M.&lt;/P&gt;&lt;P&gt;Here i want to see count of agents who contributed to 98M. First highest sales 50M,second 40M and third 30M.&lt;/P&gt;&lt;P&gt;It is reaching to more than 98M then my agent count is 3.&lt;/P&gt;&lt;P&gt;How to achieve this? Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rkpatelqlikview_0-1595582784956.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/38015iB04A03B352C812C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rkpatelqlikview_0-1595582784956.png" alt="rkpatelqlikview_0-1595582784956.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 21:08:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-of-highest-sales-contributed-agent-count-in-backend/m-p/1730566#M55704</guid>
      <dc:creator>rkpatelqlikview</dc:creator>
      <dc:date>2021-12-20T21:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: sum of highest sales contributed agent count in backend</title>
      <link>https://community.qlik.com/t5/App-Development/sum-of-highest-sales-contributed-agent-count-in-backend/m-p/1730594#M55705</link>
      <description>&lt;P&gt;in Script ?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 10:23:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-of-highest-sales-contributed-agent-count-in-backend/m-p/1730594#M55705</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-07-24T10:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: sum of highest sales contributed agent count in backend</title>
      <link>https://community.qlik.com/t5/App-Development/sum-of-highest-sales-contributed-agent-count-in-backend/m-p/1730611#M55708</link>
      <description>&lt;P&gt;Yes script level.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 11:21:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-of-highest-sales-contributed-agent-count-in-backend/m-p/1730611#M55708</guid>
      <dc:creator>rkpatelqlikview</dc:creator>
      <dc:date>2020-07-24T11:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: sum of highest sales contributed agent count in backend</title>
      <link>https://community.qlik.com/t5/App-Development/sum-of-highest-sales-contributed-agent-count-in-backend/m-p/1730614#M55710</link>
      <description>&lt;P&gt;Assuming that You have data like below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;T1:
Load date#(MonthYear,'MMM-YY') as MonthYear,Sales,Agent;
Load * Inline [
MonthYear,Agent,Sales
Jan-20,A1,30
Jan-20,A2,20
Jan-20,A3,50
Jan-20,A4,40
Feb-20,A1,40
Feb-20,A2,100
Feb-20,A3,10
Feb-20,A4,20];

Left Join(T1)
Load MonthYear,
     sum(Sales) as MonthlySales
Resident T1
Group by MonthYear;

T2:
Load *,
    if(MonthYear&amp;lt;&amp;gt;Peek(MonthYear),1,if(peek([%Accum])&amp;gt;=0.7,0,1)) as [Agent_Flag_&amp;gt;70%];
Load MonthYear,
     Sales,
     if(MonthYear&amp;lt;&amp;gt;Peek(MonthYear),Sales/MonthlySales,
     RangeSum(Sales/MonthlySales,peek([%Accum]))) as [%Accum],
     Agent
Resident T1
Order by MonthYear,Sales desc;

Drop Table T1;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can now show count of the Agent using set analysis as below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Count({&amp;lt;[Agent_Flag_&amp;gt;70%]={1}&amp;gt;}Agent)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 11:55:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-of-highest-sales-contributed-agent-count-in-backend/m-p/1730614#M55710</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-07-24T11:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: sum of highest sales contributed agent count in backend</title>
      <link>https://community.qlik.com/t5/App-Development/sum-of-highest-sales-contributed-agent-count-in-backend/m-p/1730623#M55711</link>
      <description>&lt;P&gt;Thanks Kush, Am just trying same way. I will check and update. Thanks again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 12:16:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-of-highest-sales-contributed-agent-count-in-backend/m-p/1730623#M55711</guid>
      <dc:creator>rkpatelqlikview</dc:creator>
      <dc:date>2020-07-24T12:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: sum of highest sales contributed agent count in backend</title>
      <link>https://community.qlik.com/t5/App-Development/sum-of-highest-sales-contributed-agent-count-in-backend/m-p/1730637#M55713</link>
      <description>&lt;P&gt;Thanks a lot Kush. Its giving accurate result.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 13:00:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-of-highest-sales-contributed-agent-count-in-backend/m-p/1730637#M55713</guid>
      <dc:creator>rkpatelqlikview</dc:creator>
      <dc:date>2020-07-24T13:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: sum of highest sales contributed agent count in backend</title>
      <link>https://community.qlik.com/t5/App-Development/sum-of-highest-sales-contributed-agent-count-in-backend/m-p/1730647#M55716</link>
      <description>&lt;P&gt;Glad that it worked&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 13:20:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-of-highest-sales-contributed-agent-count-in-backend/m-p/1730647#M55716</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-07-24T13:20:38Z</dc:date>
    </item>
  </channel>
</rss>

