<?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: How to apply For Loop in this problem. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329468#M835122</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can see only 3 top dealers are contributing to 50% of sales (descending) &lt;STRONG&gt;17290&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How you are getting 4 dealers? if so it's not 50% of total sales it's 60%&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 May 2017 18:20:41 GMT</pubDate>
    <dc:creator>Kushal_Chawda</dc:creator>
    <dc:date>2017-05-25T18:20:41Z</dc:date>
    <item>
      <title>How to apply For Loop in this problem.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329464#M835118</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;I am trying to achieve the following and need urgent help to build the logic/code for the same in Qlikview:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 128px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="64"&gt;&lt;STRONG&gt;Dealer ID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;&lt;STRONG&gt;Sales Qty&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;490&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;4&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;3000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;6&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;870&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;7&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;4102&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;8&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;810&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;9&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;920&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;10&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;11&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;5600&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;12&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;140&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;13&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;635&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;14&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;4700&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;15&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;323&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;16&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;17&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;1790&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;18&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;2300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;19&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;20&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;6000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Requirement:&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 344px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl69" height="20" width="64"&gt;&lt;/TD&gt;&lt;TD class="xl66" width="64"&gt;Total&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="64"&gt;A&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="64"&gt;B&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="88"&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20"&gt;X&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;20&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;6&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;Y&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;34580&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;20402&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;10880&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;&lt;P&gt;3298&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Logic:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;X(Total): &lt;/STRONG&gt;&lt;STRONG&gt;Total Count of Dealer IDs.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Y(Total): Total Sales Qty&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;XA: Count of Top dealers who have contributed in 50% of Y(Total) i.e. 17290. (Sales QTY has to be sorted in descending order)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;YA: Sum of actual Sales Qty of the dealers found in XA because they have achieved 50% sale but their actual sale is not exactly 50%.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;XB: &lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Count of NEXT Top dealers(excluding the ones counted in XA) who have contributed in next 30% of Y(Total) i.e. 10374.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;YB:&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Sum of actual Sales Qty of the dealers found in XB because they have achieved 30% sale but their actual sale is not exactly 30%.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;XC: X(Total) - (XA + XB)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;YC: Y(Total) - (YA + YB)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Somebody suggested 'For Loop' should be used but I need the correct code that gives the desired result. Any help would be highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&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/How-to-apply-For-Loop-in-this-problem/m-p/1329464#M835118</guid>
      <dc:creator>nickjose7</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply For Loop in this problem.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329465#M835119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/4003"&gt;hic&lt;/A&gt;‌&amp;nbsp; Requesting help on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Edited by Community Moderator to remove links to other spaces.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 08:07:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329465#M835119</guid>
      <dc:creator>nickjose7</dc:creator>
      <dc:date>2017-05-25T08:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply For Loop in this problem.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329466#M835120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you tell me one thing, How you are getting&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;X&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Y&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20402&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10880&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3268&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;??&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 17:50:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329466#M835120</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-05-25T17:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply For Loop in this problem.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329467#M835121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Till 17290 i got it, After that i am facing difficult to understand?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 17:51:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329467#M835121</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-05-25T17:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply For Loop in this problem.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329468#M835122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can see only 3 top dealers are contributing to 50% of sales (descending) &lt;STRONG&gt;17290&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How you are getting 4 dealers? if so it's not 50% of total sales it's 60%&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 18:20:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329468#M835122</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2017-05-25T18:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply For Loop in this problem.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329469#M835123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, Nick!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've found the solution through expressions, but it may be little complicate. So use it if you will get clear of what there is happening...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S.: And like other comments above I don't get how you've got 4 and 6 dealers. For me (using your condition) is obvious that under the 50% sales is 3 dealers, and next 30% of sales comes from another 3 dealers. As a result we have a six dealers that bring to our company &lt;SPAN style="font-size: 13.3333px;"&gt;74.3% s&lt;/SPAN&gt;ales (the last cumulative sum before it get over 80%).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.P.S: There is a way to do that with the script manipulating. But, you will lose some agile, like using variables, and you'll have to use reload for changes and so on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 19:50:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329469#M835123</guid>
      <dc:creator>Sergey_Shuklin</dc:creator>
      <dc:date>2017-05-25T19:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply For Loop in this problem.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329470#M835127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear &lt;A href="https://community.qlik.com/qlik-users/245007"&gt;serj_shu&lt;/A&gt;‌ &lt;A href="https://community.qlik.com/qlik-users/218859"&gt;loveisfail&lt;/A&gt;‌ &lt;A href="https://community.qlik.com/qlik-users/57428"&gt;kush141087&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your kind efforts!! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sorry for the confusion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution requires to &lt;STRONG&gt;Count the Top Dealers who have either matched or exceeded the 50%, next 30% and remaining 20% Sale Qty.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For example:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;50% of 34580 = 17290. But the Top three dealers' sum of Qty is only 16300 which is less than 17290 therefore we have to include the next dealer also until we either match 50% or exceed it. Hence the count becomes 4 and their actual Sales Qty is 20402.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Same applies to the next 30 &amp;amp; remaining 20.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Hope I was clear this time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dear Sergey - I would like to see your solution. Kindly share the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 06:03:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329470#M835127</guid>
      <dc:creator>nickjose7</dc:creator>
      <dc:date>2017-05-26T06:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply For Loop in this problem.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329471#M835128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, Nick!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll be glad to help. For now I don't have an opprtunity to answer, because I'm far away from my workplace. So may be few hours later I'll be able to solve your request! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt; Hope it not confuse you much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 10:35:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329471#M835128</guid>
      <dc:creator>Sergey_Shuklin</dc:creator>
      <dc:date>2017-05-26T10:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply For Loop in this problem.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329472#M835129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14957949809567831 jive_text_macro" jivemacro_uid="_14957949809567831" modifiedtitle="true"&gt;
&lt;P&gt;Data:&lt;/P&gt;
&lt;P&gt;LOAD * Inline [&lt;/P&gt;
&lt;P&gt;Dealer ID Sales Qty&lt;/P&gt;
&lt;P&gt;1 100&lt;/P&gt;
&lt;P&gt;2 2000&lt;/P&gt;
&lt;P&gt;3 490&lt;/P&gt;
&lt;P&gt;4 500&lt;/P&gt;
&lt;P&gt;5 3000&lt;/P&gt;
&lt;P&gt;6 870&lt;/P&gt;
&lt;P&gt;7 4102&lt;/P&gt;
&lt;P&gt;8 810&lt;/P&gt;
&lt;P&gt;9 920&lt;/P&gt;
&lt;P&gt;10 100&lt;/P&gt;
&lt;P&gt;11 5600&lt;/P&gt;
&lt;P&gt;12 140&lt;/P&gt;
&lt;P&gt;13 635&lt;/P&gt;
&lt;P&gt;14 4700&lt;/P&gt;
&lt;P&gt;15 323&lt;/P&gt;
&lt;P&gt;16 100&lt;/P&gt;
&lt;P&gt;17 1790&lt;/P&gt;
&lt;P&gt;18 2300&lt;/P&gt;
&lt;P&gt;19 100&lt;/P&gt;
&lt;P&gt;20 6000 ](delimiter is '\t');&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt;"&gt;Group:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;/P&gt;
&lt;P&gt;LOAD [Dealer ID],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum([Sales Qty]) as [Sales Qty Grouped]&lt;/P&gt;
&lt;P&gt;Resident Data&lt;/P&gt;
&lt;P&gt;Group by [Dealer ID];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Total:&lt;/P&gt;
&lt;P&gt;LOAD sum([Sales Qty Grouped]) as TotalSales,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count([Dealer ID]) as TotalDealers&lt;/P&gt;
&lt;P&gt;Resident Group;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;let vTotalSales =Peek('TotalSales',0,'Total');&lt;/P&gt;
&lt;P&gt;let vTotalDealers =Peek('TotalDealers',0,'Total');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Table Total;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Accum:&lt;/P&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(AccumSales&amp;lt;= $(vTotalSales)*0.5 or (AccumSales &amp;gt; $(vTotalSales)*0.5 and previous(AccumSales) &amp;lt;= $(vTotalSales)*0.5),1) as Flag;&lt;/P&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeSum([Sales Qty Grouped],Peek('AccumSales')) as AccumSales&lt;/P&gt;
&lt;P&gt;Resident Group&lt;/P&gt;
&lt;P&gt;Order by [Sales Qty Grouped] desc;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Table Group;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Final:&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;/P&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(AccumSales&amp;lt;= $(vTotalSales)*0.3 or (AccumSales &amp;gt; $(vTotalSales)*0.3 and previous(AccumSales) &amp;lt;= $(vTotalSales)*0.3),2) as Flag;&lt;/P&gt;
&lt;P&gt;LOAD [Dealer ID],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Sales Qty Grouped],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeSum([Sales Qty Grouped],Peek('AccumSales')) as AccumSales&lt;/P&gt;
&lt;P&gt;Resident Accum&lt;/P&gt;
&lt;P&gt;where Flag&amp;lt;&amp;gt;1&lt;/P&gt;
&lt;P&gt;Order by [Sales Qty Grouped] desc;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Concatenate(Final)&lt;/P&gt;
&lt;P&gt;LOAD *&lt;/P&gt;
&lt;P&gt;Resident Accum&lt;/P&gt;
&lt;P&gt;where Flag=1;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Table Accum;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Field AccumSales;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/164857_Capture.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 10:38:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329472#M835129</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2017-05-26T10:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply For Loop in this problem.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329473#M835130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, Nick!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you go - result was made with expressions.&lt;/P&gt;&lt;P&gt;And below you can find a little explanation of what's happenin in the expressions:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="expr_B.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/164918_expr_B.png" style="font-size: 13.3333px; height: 352px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;I've also added two variables for checking if the calculation is correct.&lt;/P&gt;&lt;P&gt;Note: The dealers and sales will be shown as the over values (as you want).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you like it &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 16:33:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329473#M835130</guid>
      <dc:creator>Sergey_Shuklin</dc:creator>
      <dc:date>2017-05-26T16:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply For Loop in this problem.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329474#M835131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kushal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is awesome. Thank you so much for your quickest help. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;I have checked your solution it works very well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 May 2017 07:24:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329474#M835131</guid>
      <dc:creator>nickjose7</dc:creator>
      <dc:date>2017-05-27T07:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply For Loop in this problem.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329475#M835132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sergey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Great solution. Works very well. Thank you so much for your kind help. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only difficulty I now have is to decide whose solution I mark as correct because both are absolutely fine just with a difference of Script &amp;amp; expression level.&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am marking Kushal's answer as correct just on the basis of time otherwise both solutions are greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!!&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 May 2017 07:26:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329475#M835132</guid>
      <dc:creator>nickjose7</dc:creator>
      <dc:date>2017-05-27T07:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply For Loop in this problem.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329476#M835133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad to help &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 May 2017 07:33:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329476#M835133</guid>
      <dc:creator>Sergey_Shuklin</dc:creator>
      <dc:date>2017-05-27T07:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply For Loop in this problem.</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329477#M835134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's great &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 May 2017 07:59:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-apply-For-Loop-in-this-problem/m-p/1329477#M835134</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2017-05-27T07:59:40Z</dc:date>
    </item>
  </channel>
</rss>

