<?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 Expresions problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expresions-problem/m-p/958173#M964056</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are trying to calculate a bonus for our salesmans,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where we based on there sales on every order, we take in consideration how much of the sales price is above minimum pricelist. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in script&lt;/P&gt;&lt;P&gt;(((SalesAmount) - ((minimumprice)+(shippingcost))) / ((minimumprice)+ (shippingcost))) as deviation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then we give them 7 % extra bonus on the part of the deviation that is above 12,5 % &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(((deviation - '0,125') * salesamount) * '0,07')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is working properly, but it gives the bonus above 25%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We only want to pay the extra bonus for when the&amp;nbsp; deviation is between 12,5 % to 25 %&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;salesman has a order that minimum price is 80 000 and he sales the order for 105 000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with expression above he would get bonus for the 5000 that is above 25%.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;André &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Oct 2015 11:12:11 GMT</pubDate>
    <dc:creator>harjedalskok</dc:creator>
    <dc:date>2015-10-12T11:12:11Z</dc:date>
    <item>
      <title>Expresions problem</title>
      <link>https://community.qlik.com/t5/QlikView/Expresions-problem/m-p/958173#M964056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are trying to calculate a bonus for our salesmans,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where we based on there sales on every order, we take in consideration how much of the sales price is above minimum pricelist. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in script&lt;/P&gt;&lt;P&gt;(((SalesAmount) - ((minimumprice)+(shippingcost))) / ((minimumprice)+ (shippingcost))) as deviation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then we give them 7 % extra bonus on the part of the deviation that is above 12,5 % &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(((deviation - '0,125') * salesamount) * '0,07')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is working properly, but it gives the bonus above 25%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We only want to pay the extra bonus for when the&amp;nbsp; deviation is between 12,5 % to 25 %&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;salesman has a order that minimum price is 80 000 and he sales the order for 105 000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with expression above he would get bonus for the 5000 that is above 25%.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;André &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 11:12:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expresions-problem/m-p/958173#M964056</guid>
      <dc:creator>harjedalskok</dc:creator>
      <dc:date>2015-10-12T11:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Expresions problem</title>
      <link>https://community.qlik.com/t5/QlikView/Expresions-problem/m-p/958174#M964057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe something 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; font-size: 13px;"&gt;sum((( rangemin( deviation, 0.25) - '0,125') * salesamount) * '0,07')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;or even cutting off lower end:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;sum((( rangemax(rangemin( deviation, 0.25) - 0.125),0) * salesamount) * '0,07')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 11:29:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expresions-problem/m-p/958174#M964057</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-10-12T11:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Expresions problem</title>
      <link>https://community.qlik.com/t5/QlikView/Expresions-problem/m-p/958175#M964058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for fast reply, ive tryied them both, and the above is working, the above give me a error on the comma and the zero after -0,125)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for now i have it in the script as an option:&lt;/P&gt;&lt;P&gt;if(&amp;nbsp;&amp;nbsp;&amp;nbsp; (((SalesAmount) - ((minimumprice)+(shippingcost))) / ((minimumprice)+ (shippingcost))) &amp;gt;= '0,125', 'Yes', 'No' ) as Approved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 14:03:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expresions-problem/m-p/958175#M964058</guid>
      <dc:creator>harjedalskok</dc:creator>
      <dc:date>2015-10-12T14:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Expresions problem</title>
      <link>https://community.qlik.com/t5/QlikView/Expresions-problem/m-p/958176#M964059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ment the second one has an syntax error. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 14:04:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expresions-problem/m-p/958176#M964059</guid>
      <dc:creator>harjedalskok</dc:creator>
      <dc:date>2015-10-12T14:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Expresions problem</title>
      <link>https://community.qlik.com/t5/QlikView/Expresions-problem/m-p/958177#M964060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think some brackets need to be rearranged:&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; font-size: 13px; background-color: #f2f2f2;"&gt;sum(( rangemax( (rangemin( deviation, 0.25) - 0.125) ,0) * salesamount) * 0.07)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 14:10:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expresions-problem/m-p/958177#M964060</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-10-12T14:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Expresions problem</title>
      <link>https://community.qlik.com/t5/QlikView/Expresions-problem/m-p/958178#M964061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thx Alot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You saved my day!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/André &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 14:15:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expresions-problem/m-p/958178#M964061</guid>
      <dc:creator>harjedalskok</dc:creator>
      <dc:date>2015-10-12T14:15:10Z</dc:date>
    </item>
  </channel>
</rss>

