<?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: Query Help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Query-Help/m-p/1174226#M910001</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please mark as correct .. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Jun 2016 20:30:53 GMT</pubDate>
    <dc:creator>ziadm</dc:creator>
    <dc:date>2016-06-12T20:30:53Z</dc:date>
    <item>
      <title>Query Help</title>
      <link>https://community.qlik.com/t5/QlikView/Query-Help/m-p/1174221#M909996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi just wondering if anyone can help with a query. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the attached excel file you can see my calculations and below is explaining what I am trying to do, if i am not clear i will try make it clearer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;As you can see each ID has multiple different incomes. What I want to calculate is too different things I am just not sure if my query is correct. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;There are two different calculations I want to make when the sum of sales is in the range of 0 to 15 and when the sum of sales is between 15 and 25. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When an account has gross sales between 0 - 15 the calculation you get Fee + sum of Commission so for ID 1111 this would be 5+ 25 = 30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When an account has gross sales between 15 and 25 It is calculated as Charge - sum of sales + sum of commission amount. So for ID 2222 it would be 15-7 = 8 + 6 = 14.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then ID 3333 the gross of sales is&amp;nbsp; above 25 so I don't need to calculate it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a straight table with the Dimension of ID and three expressions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Label sales and it's sum(Sales) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Commission Due as the label and the query which I am unsure about this is what I have attempted but I don't seem to be getting back the results I am looking for. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Sum(Sales)&amp;gt;15 and Sum(Sales)&amp;lt;25 = Charge-(Sum(Sales))+Sum(Commission), If (Sum(Sales)&amp;lt;15 = Sum(Commission))+[Fees])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then label Charge and value Charge.&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" height="375" style="width: 801px; height: 377px;"&gt;&lt;TBODY&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Query-Help/m-p/1174221#M909996</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Query Help</title>
      <link>https://community.qlik.com/t5/QlikView/Query-Help/m-p/1174222#M909997</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;How about this in the chart table where your dimension is ID and your expression is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aggr(if(sum(Sales) &amp;lt;= 15,sum(Commission) + sum(Fees),if(sum(Sales)&amp;gt;15,Charge-(Sum(Sales))+Sum(Commission),0)),ID)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jun 2016 17:58:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Query-Help/m-p/1174222#M909997</guid>
      <dc:creator>ziadm</dc:creator>
      <dc:date>2016-06-12T17:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Query Help</title>
      <link>https://community.qlik.com/t5/QlikView/Query-Help/m-p/1174223#M909998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;use Only Aggr function is have onle value for the Charge field&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Aggr(if(sum(Sales) &amp;lt;= 15,sum(Commission) + sum(Fees),if(sum(Sales)&amp;gt;15,only(Charge)- (Sum(Sales))+Sum(Commission),0)),ID)&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jun 2016 18:10:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Query-Help/m-p/1174223#M909998</guid>
      <dc:creator>ziadm</dc:creator>
      <dc:date>2016-06-12T18:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Query Help</title>
      <link>https://community.qlik.com/t5/QlikView/Query-Help/m-p/1174224#M909999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ziad that worked&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jun 2016 20:09:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Query-Help/m-p/1174224#M909999</guid>
      <dc:creator />
      <dc:date>2016-06-12T20:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Query Help</title>
      <link>https://community.qlik.com/t5/QlikView/Query-Help/m-p/1174225#M910000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your question is now answered, flag the Correct Answer.&lt;/P&gt;&lt;P&gt;If not, please make clear with what part of this topic we can still help you &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jun 2016 20:11:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Query-Help/m-p/1174225#M910000</guid>
      <dc:creator>oknotsen</dc:creator>
      <dc:date>2016-06-12T20:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Query Help</title>
      <link>https://community.qlik.com/t5/QlikView/Query-Help/m-p/1174226#M910001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please mark as correct .. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jun 2016 20:30:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Query-Help/m-p/1174226#M910001</guid>
      <dc:creator>ziadm</dc:creator>
      <dc:date>2016-06-12T20:30:53Z</dc:date>
    </item>
  </channel>
</rss>

