<?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: Expession Help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expession-Help/m-p/726873#M260563</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for the total, you need to sum the results for each record&lt;/P&gt;&lt;P&gt;sum(aggr(if(sum(loan_amt)&amp;lt;=500000,sum(loan_amt)*.0035,0),LoanOfficer))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Jul 2014 14:46:28 GMT</pubDate>
    <dc:creator>martinpohl</dc:creator>
    <dc:date>2014-07-07T14:46:28Z</dc:date>
    <item>
      <title>Expession Help</title>
      <link>https://community.qlik.com/t5/QlikView/Expession-Help/m-p/726870#M260560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am looking to calculate what the commission would be for each salesperson. The more units they sell the higher percentage they&amp;nbsp; make on each sale.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example if you sell &amp;lt; 500,000 total for a month , you make .0035 on each sale. Over 500,000 you make .0050 on each sale.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using Aggr function for the first part, but no luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Aggr(sum(loan_amt),LoanOfficer)&amp;lt;=500000,(loan_amt * .0035),0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It only returns the aggr value on1 record not all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 14:33:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expession-Help/m-p/726870#M260560</guid>
      <dc:creator />
      <dc:date>2014-07-07T14:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Expession Help</title>
      <link>https://community.qlik.com/t5/QlikView/Expession-Help/m-p/726871#M260561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm assuming your chart has a dimension of salesperson?&amp;nbsp; If so, try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=(sum(loan_amt) * .0035) + ((sum(loan_amt) - 5000) * .0015)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 14:41:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expession-Help/m-p/726871#M260561</guid>
      <dc:creator>joshabbott</dc:creator>
      <dc:date>2014-07-07T14:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Expession Help</title>
      <link>https://community.qlik.com/t5/QlikView/Expession-Help/m-p/726872#M260562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why so complicated?&lt;/P&gt;&lt;P&gt;I assume that in your base_data table, you have one line for every individual sales_process, yes?&lt;/P&gt;&lt;P&gt;=&amp;gt; So first you'd have to aggregate your table by salesperson to find out how much every one of them sold.&lt;/P&gt;&lt;P&gt;That is in the help_file. The important things about this are that you need a GROUP BY clause and&lt;/P&gt;&lt;P&gt;you have to take care to keep only those fields you want in your aggregation - just think logically:&lt;/P&gt;&lt;P&gt;==&amp;gt;&amp;gt; QlikView will &lt;SPAN style="text-decoration: underline;"&gt;group by&lt;/SPAN&gt; every field you have in the GROUP BY clause - so if you keep the item_nr in there, you will get only very small sums - the total of sales of one specific item by one salesperson, which is probably not what you want.&lt;/P&gt;&lt;P&gt;Better keep just the date, salesperson and [sales] field for the aggregation and join the remainder afterwards.&lt;/P&gt;&lt;P&gt;=&amp;gt; So then you know how much any individual salesperson sold and then you can generate an additional field with the commission by using an IF_construct and the tresholds you have.&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 14:46:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expession-Help/m-p/726872#M260562</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-07-07T14:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Expession Help</title>
      <link>https://community.qlik.com/t5/QlikView/Expession-Help/m-p/726873#M260563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for the total, you need to sum the results for each record&lt;/P&gt;&lt;P&gt;sum(aggr(if(sum(loan_amt)&amp;lt;=500000,sum(loan_amt)*.0035,0),LoanOfficer))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 14:46:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expession-Help/m-p/726873#M260563</guid>
      <dc:creator>martinpohl</dc:creator>
      <dc:date>2014-07-07T14:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Expession Help</title>
      <link>https://community.qlik.com/t5/QlikView/Expession-Help/m-p/726874#M260564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=If( Sum(TOTAL loan_amt) &amp;lt;= 500000, (S&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;um( loan_amt ) &lt;/SPAN&gt; * .0035) , (Sum( loan_amt ) * .0015 ) )&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 14:49:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expession-Help/m-p/726874#M260564</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-07-07T14:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Expession Help</title>
      <link>https://community.qlik.com/t5/QlikView/Expession-Help/m-p/726875#M260565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IF(SUM(loan_amt)&amp;lt;500000, SUM(loan_amt)*.0035,&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(SUM(loan_amt)&amp;gt;=500000, SUM(loan_amt)*.0050))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;If you want the total amount of commission, use below…&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;=&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue;"&gt;AGGR&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: maroon;"&gt;loan_amt&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;)&amp;lt;500000, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: maroon;"&gt;loan_amt&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;)*.0035,&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: maroon;"&gt;loan_amt&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;)&amp;gt;=500000, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: maroon;"&gt;loan_amt&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;)*.0050)),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: maroon;"&gt;LoanOfficer&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 14:55:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expession-Help/m-p/726875#M260565</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-07-07T14:55:49Z</dc:date>
    </item>
  </channel>
</rss>

