<?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: For each Loop, within the SAME table? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718868#M674226</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nico,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this for your final load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;POReworkTableFinal:&lt;/P&gt;&lt;P&gt;NOCONCATENATE LOAD&lt;/P&gt;&lt;P&gt;LeftOrderNUm, &lt;/P&gt;&lt;P&gt;FinalPoNumber as varTestingPORec,&lt;/P&gt;&lt;P&gt;order_number,&lt;/P&gt;&lt;P&gt;if(peek('LeftOrderNUm',-1) = [LeftOrderNUm],'Previous Increment', 'Final Increment') as KeepThisPOrecord&lt;/P&gt;&lt;P&gt;RESIDENT POReworkTableLoad&lt;/P&gt;&lt;P&gt;ORDER BY order_number desc;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Jul 2014 12:37:41 GMT</pubDate>
    <dc:creator>marcus_malinow</dc:creator>
    <dc:date>2014-07-29T12:37:41Z</dc:date>
    <item>
      <title>For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718846#M674204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Day!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm hoping someone can help me in implementing the following logic inside the Script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Record1 then&lt;/P&gt;&lt;P&gt;Load Record2 then&lt;/P&gt;&lt;P&gt;Compare Record1 vs Record2 then&lt;/P&gt;&lt;P&gt;## Do some logic&lt;/P&gt;&lt;P&gt;Repeat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i do something like that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whoever's assistance is much appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nico&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 11:07:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718846#M674204</guid>
      <dc:creator>nico_ilog</dc:creator>
      <dc:date>2014-07-21T11:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718847#M674205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nico,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use &lt;STRONG&gt;IF Then else &lt;/STRONG&gt; condition looping.&lt;/P&gt;&lt;P&gt;The &lt;SPAN class="Bold"&gt;if..then&lt;/SPAN&gt; control statement is a script selection construct forcing the script execution to follow different paths depending on one or several logical conditions. The syntax is:&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Bold"&gt;if&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt; condition &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;then&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;&amp;nbsp; [ statements ] &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;{ &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;elseif&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt; condition &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;then&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;&amp;nbsp; [ statements ] } &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;[ &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;else&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;&amp;nbsp; [ statements ] ] &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Bold"&gt;end if&lt;/P&gt;&lt;P&gt;Where:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;condition&lt;/SPAN&gt; is a logical expression which can be evaluated as true or false. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;statements&lt;/SPAN&gt; is any group of one or more QlikView script statements. &lt;/P&gt;&lt;P&gt;Since the &lt;SPAN class="Bold"&gt;if..then&lt;/SPAN&gt; statement is a control statement and as such is ended with either a semicolon or end-of-line, each of its four possible clauses (&lt;SPAN class="Bold"&gt;if..then&lt;/SPAN&gt;, &lt;SPAN class="Bold"&gt;elseif..then&lt;/SPAN&gt;, &lt;SPAN class="Bold"&gt;else&lt;/SPAN&gt; and &lt;SPAN class="Bold"&gt;end if&lt;/SPAN&gt;) must not cross a line boundary. &lt;/P&gt;&lt;P class="example"&gt;Examples:&lt;/P&gt;&lt;P class="Code"&gt;if a=1 then&lt;/P&gt;&lt;P class="Code"&gt;load * from abc.csv;&lt;/P&gt;&lt;P class="Code"&gt;sql select e, f, g from tab1;&lt;/P&gt;&lt;P class="Code"&gt;end if&lt;/P&gt;&lt;P class="Code"&gt;&lt;/P&gt;&lt;P class="Code"&gt;if a=1 then; drop table xyz; end if;&lt;/P&gt;&lt;P class="Code"&gt;&lt;/P&gt;&lt;P class="Code"&gt;if x&amp;gt;0 then&lt;/P&gt;&lt;P class="Code"&gt;load * from pos.csv;&lt;/P&gt;&lt;P class="Code"&gt;elseif x&amp;lt;0 then&lt;/P&gt;&lt;P class="Code"&gt;load * from neg.csv;&lt;/P&gt;&lt;P class="Code"&gt;else&lt;/P&gt;&lt;P class="Code"&gt;load * from zero.txt;&lt;/P&gt;&lt;P class="Code"&gt;end if&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 11:12:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718847#M674205</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2014-07-21T11:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718848#M674206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nico,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd suggest using the peek function. As long as the&amp;nbsp; ordering of your table is correct you should be able to avoid loops and still compare records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll need to do a RESIDENT load from your previously loaded table, and make sure you have an ORDER BY clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcus &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 11:13:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718848#M674206</guid>
      <dc:creator>marcus_malinow</dc:creator>
      <dc:date>2014-07-21T11:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718849#M674207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you please explain a little bit of your requirement.&lt;/P&gt;&lt;P&gt;if you just want to load the data from the second table based on the field values of table 1 then in that case the exist function can be useful.&lt;/P&gt;&lt;P&gt;if you want to do a record by record compare then for loop with peek function to fetch row wise data is required.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 11:22:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718849#M674207</guid>
      <dc:creator>sudeepkm</dc:creator>
      <dc:date>2014-07-21T11:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718850#M674208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Avinash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanx for the reply! But i dont want to load from different table, based on the outcome of a condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The scenario is this:&lt;/P&gt;&lt;P&gt;Quotations are created, then as they are ammended, they start superseeding the previous increments. I need to use only the last increment, and not the previous increments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See below:&lt;/P&gt;&lt;P&gt;Quote number&lt;/P&gt;&lt;P&gt;Q1002 - FIRST INCREMENT&lt;/P&gt;&lt;P&gt;Q1003&lt;/P&gt;&lt;P&gt;Q1002.1&lt;/P&gt;&lt;P&gt;Q1002.2&lt;/P&gt;&lt;P&gt;Q1002.3&lt;/P&gt;&lt;P&gt;Q1002.4 - LAST AMMENDMENT &amp;lt;-- THIS IS THE RECORD I WANT TO LOAD.&lt;/P&gt;&lt;P&gt;Q1003.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my logic is, load the first record, Left function by the ".", then load the second record. If they are the same, store the bigger increment as the record name that has been "Lefted".&lt;/P&gt;&lt;P&gt;Q1002 will be stored, using the values of Q1002.4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you can follow the logic im trying to portray?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 11:25:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718850#M674208</guid>
      <dc:creator>nico_ilog</dc:creator>
      <dc:date>2014-07-21T11:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718851#M674209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;look at Peek function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;ASHFAQ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 11:25:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718851#M674209</guid>
      <dc:creator>ashfaq_haseeb</dc:creator>
      <dc:date>2014-07-21T11:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718852#M674210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanx Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see my reply to AV.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 11:25:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718852#M674210</guid>
      <dc:creator>nico_ilog</dc:creator>
      <dc:date>2014-07-21T11:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718853#M674211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sudeep.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx for the comment. Please see my response to AV&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 11:29:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718853#M674211</guid>
      <dc:creator>nico_ilog</dc:creator>
      <dc:date>2014-07-21T11:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718854#M674212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok then,&lt;/P&gt;&lt;P&gt;something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Left([Quote number], 5) as TrimmedQuoteNbr&lt;/P&gt;&lt;P&gt;[Quote Number]&lt;/P&gt;&lt;P&gt;if(peek('TrimmedQuoteNbr', -1) =&amp;nbsp; left([Quote Number], 5),0, 1) as KeepThisrecord&lt;/P&gt;&lt;P&gt;RESIDENT SourceTable&lt;/P&gt;&lt;P&gt;ORDER BY [Quote Number] desc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 11:29:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718854#M674212</guid>
      <dc:creator>marcus_malinow</dc:creator>
      <dc:date>2014-07-21T11:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718855#M674213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yea!! Something like that! Just briefly, explain what this line does for the script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;LOAD Left([Quote number], 5) as TrimmedQuoteNbr&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;STRONG&gt;[Quote Number] &amp;lt;-- This line?&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;if(peek('TrimmedQuoteNbr', -1) =&amp;nbsp; left([Quote Number], 5),0, 1) as KeepThisrecord&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;RESIDENT SourceTable&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;ORDER BY [Quote Number] desc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll give it a shot shortly! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 11:32:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718855#M674213</guid>
      <dc:creator>nico_ilog</dc:creator>
      <dc:date>2014-07-21T11:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718856#M674214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Trimmed Quote Number is&amp;nbsp; being used for the comparison&lt;/P&gt;&lt;P&gt;Quote Number&amp;nbsp; is just your original Quote Number, in case&amp;nbsp; you need to keep it, and useful for debugging&lt;/P&gt;&lt;P&gt;The Peek condition compares&amp;nbsp; the prior records Trimmed Quote Number with the same value for the current record, and if they're the same it flags the record with a zero (meaning you can ditch that record at a later stage)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe this could be a bit more robust&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of&lt;/P&gt;&lt;P&gt;Left([Quote Number], 5)&lt;/P&gt;&lt;P&gt;Use &lt;/P&gt;&lt;P&gt;Left([Quote Number], Index([Quote Number] &amp;amp; '.', '.') - 1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 11:38:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718856#M674214</guid>
      <dc:creator>marcus_malinow</dc:creator>
      <dc:date>2014-07-21T11:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718857#M674215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hope you got the&amp;nbsp; &lt;A href="https://community.qlik.com/qlik-users/26760"&gt;Marcus Malinow&lt;/A&gt;&amp;nbsp; explanation, if your still facing any issues please post your app. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 11:45:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718857#M674215</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2014-07-21T11:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718858#M674216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The More robust method works better!&lt;/P&gt;&lt;P&gt;But, it doesn't link me to the highest incremented record? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me play around with it! It should work! Will revert back if it does/ doesn't! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Nico&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 11:49:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718858#M674216</guid>
      <dc:creator>nico_ilog</dc:creator>
      <dc:date>2014-07-21T11:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718859#M674217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, looks like the ORDER BY clause might not be working correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could try adding a field like so to determine the ordering that is&amp;nbsp; being&amp;nbsp; applied&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RecNo() as RecordNumber&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 11:54:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718859#M674217</guid>
      <dc:creator>marcus_malinow</dc:creator>
      <dc:date>2014-07-21T11:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718860#M674218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marcus!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ok i tried, and im busy with it.. but im stuck! I got as far so that it indicated what record was the first increment! But when i try to select the FINAL incerement, it simply selects all the records, that are NOT the first increment?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am i missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see below.&lt;/P&gt;&lt;P&gt;Quotes2:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(WildMatch(QuoteNumber,'*.*') = 1,Right(QuoteNumber, len(QuoteNumber)-Index(QuoteNumber, '.')),'1st Increment')&amp;nbsp; as IncrementedNumber,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; QuoteNumber &lt;/P&gt;&lt;P&gt;Resident QuoteHeaders&amp;nbsp; Order By QuoteNumber;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quotes3:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;IncrementedNumber as varTestingRec,&lt;/P&gt;&lt;P&gt;QuoteNumber,&lt;/P&gt;&lt;P&gt;if(peek(varTestingRec,-1) &amp;lt;&amp;nbsp; [IncrementedNumber],'Final Increment','Previous Increment') as KeepThisrecord&lt;/P&gt;&lt;P&gt;RESIDENT Quotes2&lt;/P&gt;&lt;P&gt;ORDER BY [QuoteNumber];&lt;/P&gt;&lt;P&gt;&lt;IMG alt="After selection.JPG.jpg" class="jive-image" src="/legacyfs/online/62791_After selection.JPG.jpg" /&gt;&lt;IMG alt="Before Selection.JPG.jpg" class="jive-image" src="/legacyfs/online/62798_Before Selection.JPG.jpg" style="max-width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 13:53:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718860#M674218</guid>
      <dc:creator>nico_ilog</dc:creator>
      <dc:date>2014-07-21T13:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718861#M674219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of&lt;/P&gt;&lt;P&gt;Order By QuoteNumber,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Order By QuoteNumber &lt;STRONG&gt;DESC&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 13:59:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718861#M674219</guid>
      <dc:creator>marcus_malinow</dc:creator>
      <dc:date>2014-07-21T13:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718862#M674220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style="text-decoration: underline;"&gt;Absolutely AMAZING! &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style="text-decoration: underline;"&gt;It works perfectly!!! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why does that make a Diff? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 14:04:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718862#M674220</guid>
      <dc:creator>nico_ilog</dc:creator>
      <dc:date>2014-07-21T14:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718863#M674221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically, say you have three records:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q2007&lt;/P&gt;&lt;P&gt;Q2007.2&lt;/P&gt;&lt;P&gt;Q2007.3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're interested in the one with the largest Quote Number, so ordering in descending order will allow you to pick that up before the other two records.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 14:08:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718863#M674221</guid>
      <dc:creator>marcus_malinow</dc:creator>
      <dc:date>2014-07-21T14:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718864#M674222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ahh! Ok Perfect!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcus, your assistance is noted with a High Degree of appreciation!&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/cool.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 14:14:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718864#M674222</guid>
      <dc:creator>nico_ilog</dc:creator>
      <dc:date>2014-07-21T14:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: For each Loop, within the SAME table?</title>
      <link>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718865#M674223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Day Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please provide some assistance on the above mentioned.&lt;/P&gt;&lt;P&gt;O can now properly identify the Final Increments.&lt;/P&gt;&lt;P&gt;What is however happening is that fact that the records, which are final increments from the start (i.e. No increments) as situated below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Po1001&lt;/P&gt;&lt;P&gt;Po1001.1&lt;/P&gt;&lt;P&gt;Po1002 &amp;lt;-- This record is thrown away, because it has no increment.&lt;/P&gt;&lt;P&gt;Po1003&lt;/P&gt;&lt;P&gt;Po1003.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can i do to keep those increments? I've been trying some weird combinations, but im not getting it to work?&lt;/P&gt;&lt;P&gt;Please see code below:&lt;/P&gt;&lt;P&gt;//PO&lt;/P&gt;&lt;P&gt;POReworkTableLoad:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;if(WildMatch(IncrementedPONumber,'*.*') = 1,Right(IncrementedPONumber, len(IncrementedPONumber)-Index(IncrementedPONumber, '.')))&amp;nbsp; as FinalPoNumber,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IncrementedPONumber as Increments,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Left(order_number,6) as LeftOrderNUm,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; order_number ;&lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(NOT WildMatch(order_number,'*.*'),order_number&amp;amp;'.0',order_number)&amp;nbsp; as IncrementedPONumber,&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; order_number &lt;/P&gt;&lt;P&gt;Resident POs&amp;nbsp; Order By order_number DESC;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;POReworkTableFinal:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;FinalPoNumber as varTestingPORec,&lt;/P&gt;&lt;P&gt;order_number,&lt;/P&gt;&lt;P&gt;if(peek(varTestingPORec,-1) &amp;lt;&amp;nbsp; [FinalPoNumber],'Final Increment','Previous Increment') as KeepThisPOrecord&lt;/P&gt;&lt;P&gt;RESIDENT POReworkTableLoad&lt;/P&gt;&lt;P&gt;ORDER BY [order_number] DESC;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 12:08:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-each-Loop-within-the-SAME-table/m-p/718865#M674223</guid>
      <dc:creator>nico_ilog</dc:creator>
      <dc:date>2014-07-29T12:08:25Z</dc:date>
    </item>
  </channel>
</rss>

