<?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: Isolating High Sales by Month in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Isolating-High-Sales-by-Month/m-p/287044#M1182409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, on large data, the expression using aggr() will be probably not perfomant enough.&lt;/P&gt;&lt;P&gt;The problem is here, that we need to aggregate monthly sales per Agent to decide if we need to include or exclude the sales amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed that my expression could actually be more simple:&lt;/P&gt;&lt;P&gt;=sum(aggr(if(Sum([Sale Amount])&amp;gt;50000,sum([Sale Amount])),Month,Agent))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe this will improve a bit on performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you could precalculate the monthly sales per agent in the script, you could then use a good performing set analysis to filter your records:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT:&lt;/P&gt;&lt;P&gt;LOAD Agent, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AutoNumber(Agent&amp;amp;Month) as AgentMonthID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Sale #], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Sale Amount]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;comm45540_Agents.xls&lt;/P&gt;&lt;P&gt;(biff, embedded labels, table is Sheet1$);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD autonumber(Agent&amp;amp;Month) as AgentMonthID, sum([Sale Amount]) as SumSales resident INPUT group by Month, Agent;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, an expression like&lt;/P&gt;&lt;P&gt;sum({&amp;lt;[SumSales] = {"&amp;gt;50000"}&amp;gt;}[Sale Amount])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will return the top Sales only. The downside is, this will not reflect any selections in other fields you may have, like Product.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See also attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 21 Jan 2012 14:49:25 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-01-21T14:49:25Z</dc:date>
    <item>
      <title>Isolating High Sales by Month</title>
      <link>https://community.qlik.com/t5/QlikView/Isolating-High-Sales-by-Month/m-p/287041#M1182406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to create a graph that shows what percent of each month's sales total was contributed by agents who had at least 50,000 in sales that month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a table with a list of all the sales. It has the fields SalesAmt and MonthAgent (which is a key to connect to the Agent table). There is also a MonthAgent table, that lists the agents that are active each month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a simple example, let's say there are three agents and three months and a total of 20 different sales transactions. I've attached an example in Excel and the steps to arrive at the answer. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm pretty sure this can be done in QlikView, but am not sure where to start. I appreciate any help! Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 16:22:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Isolating-High-Sales-by-Month/m-p/287041#M1182406</guid>
      <dc:creator />
      <dc:date>2012-01-18T16:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Isolating High Sales by Month</title>
      <link>https://community.qlik.com/t5/QlikView/Isolating-High-Sales-by-Month/m-p/287042#M1182407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you can use something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(aggr(if(Sum(total&amp;lt;Month,Agent&amp;gt; [Sale Amount])&amp;gt;50000,[Sale Amount]),Month,Agent,[Sale #]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as expression in a chart to get the Top Agents Sales. Then calculating the Percentage is just above divided by Total Sales per Month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See also attached sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 17:23:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Isolating-High-Sales-by-Month/m-p/287042#M1182407</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-01-18T17:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Isolating High Sales by Month</title>
      <link>https://community.qlik.com/t5/QlikView/Isolating-High-Sales-by-Month/m-p/287043#M1182408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't had a ton of time to get back to this problem, but it seems like it is in the right direction. When I run it, though, given the millions of sales transactions, the server gets bogged down and qv doesn't respond. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2012 19:20:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Isolating-High-Sales-by-Month/m-p/287043#M1182408</guid>
      <dc:creator />
      <dc:date>2012-01-20T19:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Isolating High Sales by Month</title>
      <link>https://community.qlik.com/t5/QlikView/Isolating-High-Sales-by-Month/m-p/287044#M1182409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, on large data, the expression using aggr() will be probably not perfomant enough.&lt;/P&gt;&lt;P&gt;The problem is here, that we need to aggregate monthly sales per Agent to decide if we need to include or exclude the sales amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed that my expression could actually be more simple:&lt;/P&gt;&lt;P&gt;=sum(aggr(if(Sum([Sale Amount])&amp;gt;50000,sum([Sale Amount])),Month,Agent))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe this will improve a bit on performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you could precalculate the monthly sales per agent in the script, you could then use a good performing set analysis to filter your records:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT:&lt;/P&gt;&lt;P&gt;LOAD Agent, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AutoNumber(Agent&amp;amp;Month) as AgentMonthID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Sale #], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Sale Amount]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;comm45540_Agents.xls&lt;/P&gt;&lt;P&gt;(biff, embedded labels, table is Sheet1$);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD autonumber(Agent&amp;amp;Month) as AgentMonthID, sum([Sale Amount]) as SumSales resident INPUT group by Month, Agent;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, an expression like&lt;/P&gt;&lt;P&gt;sum({&amp;lt;[SumSales] = {"&amp;gt;50000"}&amp;gt;}[Sale Amount])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will return the top Sales only. The downside is, this will not reflect any selections in other fields you may have, like Product.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See also attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jan 2012 14:49:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Isolating-High-Sales-by-Month/m-p/287044#M1182409</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-01-21T14:49:25Z</dc:date>
    </item>
  </channel>
</rss>

