<?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: loop in script? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/loop-in-script/m-p/524173#M1150602</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's always good to post some sample lines of input data and your expected result to play with and for verification, so I built something myself:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT:&lt;/P&gt;&lt;P&gt;LOAD *, recno() as OrderID INLINE [&lt;/P&gt;&lt;P&gt;OrderDate, ShippingDate,SelledPrice&lt;/P&gt;&lt;P&gt;2013-06-19,2013-06-30, 100&lt;/P&gt;&lt;P&gt;2013-06-19,2013-06-30, 90&lt;/P&gt;&lt;P&gt;2013-06-09,2013-06-30, 100&lt;/P&gt;&lt;P&gt;2013-06-25,2013-06-30, 100&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD OrderID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rangemax(0, if(SelledPrice=100, (ShippingDate-OrderDate-10)*10)) as Fee&lt;/P&gt;&lt;P&gt;RESIDENT INPUT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or if you want to group by OrderDate, replace last LOAD with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD OrderDate, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(rangemax(0, if(SelledPrice=100, (ShippingDate-OrderDate-10)*10))) as SummedFee&lt;/P&gt;&lt;P&gt;RESIDENT INPUT order by OrderDate;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 30 Jun 2013 11:56:52 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2013-06-30T11:56:52Z</dc:date>
    <item>
      <title>loop in script?</title>
      <link>https://community.qlik.com/t5/QlikView/loop-in-script/m-p/524172#M1150601</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 have a table of Orders: Order Date, Shipping date and Selled_Price.&lt;/P&gt;&lt;P&gt;If the Price is 100 and the shipping date is 10 days after order day than the customer pay 10$ each day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create table showing how much money recieved per each order day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should i make a new table on script with a loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tnks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Jun 2013 09:16:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/loop-in-script/m-p/524172#M1150601</guid>
      <dc:creator>Alma1234</dc:creator>
      <dc:date>2013-06-30T09:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: loop in script?</title>
      <link>https://community.qlik.com/t5/QlikView/loop-in-script/m-p/524173#M1150602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's always good to post some sample lines of input data and your expected result to play with and for verification, so I built something myself:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT:&lt;/P&gt;&lt;P&gt;LOAD *, recno() as OrderID INLINE [&lt;/P&gt;&lt;P&gt;OrderDate, ShippingDate,SelledPrice&lt;/P&gt;&lt;P&gt;2013-06-19,2013-06-30, 100&lt;/P&gt;&lt;P&gt;2013-06-19,2013-06-30, 90&lt;/P&gt;&lt;P&gt;2013-06-09,2013-06-30, 100&lt;/P&gt;&lt;P&gt;2013-06-25,2013-06-30, 100&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD OrderID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rangemax(0, if(SelledPrice=100, (ShippingDate-OrderDate-10)*10)) as Fee&lt;/P&gt;&lt;P&gt;RESIDENT INPUT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or if you want to group by OrderDate, replace last LOAD with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD OrderDate, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(rangemax(0, if(SelledPrice=100, (ShippingDate-OrderDate-10)*10))) as SummedFee&lt;/P&gt;&lt;P&gt;RESIDENT INPUT order by OrderDate;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Jun 2013 11:56:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/loop-in-script/m-p/524173#M1150602</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-06-30T11:56:52Z</dc:date>
    </item>
  </channel>
</rss>

