<?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 How can I iterate a loaded table in script and comapre values between lines/records? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-can-I-iterate-a-loaded-table-in-script-and-comapre-values/m-p/196173#M56360</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Thanks. Inter-record Previous-function helps to some extent. But in my data&lt;BR /&gt;the chain of start and end dates can be long, say e.g. 10 records.&lt;BR /&gt;It's ok to write previous once or twice but previous(previous(previous(... no more&lt;BR /&gt;&lt;BR /&gt;How can I write in a more elegant way the following ugly deep if structure in load.&lt;BR /&gt;In addition to the day condition two other fields must match.&lt;BR /&gt;&lt;BR /&gt;if(field_1 &amp;lt;&amp;gt; previous(field_1), keyValue,&lt;BR /&gt;if(field_2 &amp;lt;&amp;gt; previous(field_2), keyValue,&lt;BR /&gt;if(startDate &amp;lt;&amp;gt; previous(endDate) + 1, keyValue,&lt;BR /&gt;&lt;BR /&gt;// 1st match backwards found. Any more?&lt;BR /&gt;&lt;BR /&gt;if(previous(field_1) &amp;lt;&amp;gt; previous(previous(field_1)), previous(keyValue),&lt;BR /&gt;if(previous(field_2) &amp;lt;&amp;gt; previous(previous(field_2)), previous(keyValue),&lt;BR /&gt;if(previous(startDate) &amp;lt;&amp;gt; previous(previous(endDate)) + 1, previous(keyValue),&lt;BR /&gt;&lt;BR /&gt;// 2nd match backwards found. Any more?&lt;BR /&gt;&lt;BR /&gt;if(previous(previous(field_1)) &amp;lt;&amp;gt; previous(previous(previous(field_1))), previous(previous(keyValue)),&lt;BR /&gt;if(previous(previous(field_2)) &amp;lt;&amp;gt; previous(previous(previous(field_2))), previous(previous(keyValue)),&lt;BR /&gt;if(previous(previous(startDate)) &amp;lt;&amp;gt; previous(previous(previous(endDate))) + 1, previous(previous(keyValue)),&lt;BR /&gt;&lt;BR /&gt;// 3rd match backwards found. But there can be more.&lt;BR /&gt;previous(previous(previous(keyValue))))))))))))&lt;BR /&gt;as newKeyValue,&lt;/P&gt;&lt;P&gt;T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Apr 2011 14:29:22 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-04-14T14:29:22Z</dc:date>
    <item>
      <title>How can I iterate a loaded table in script and comapre values between lines/records?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-iterate-a-loaded-table-in-script-and-comapre-values/m-p/196171#M56358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I iterate a loaded table in script and compare values between lines/records?&lt;BR /&gt;&lt;BR /&gt;There are in my table startDate, endDate and keyValue generated from startDate and some other fields.&lt;BR /&gt;Now if the startDate is one more than some previous endDate the keyValue should be the very same&lt;BR /&gt;as in the previous record&lt;BR /&gt;&lt;BR /&gt;startDate endDate keyValue&lt;BR /&gt;20110325 20110327 20110325_plusotherstuff1&lt;BR /&gt;20110330 20110401 20110330_plusotherstuff2&lt;BR /&gt;20110402 20110403 20110330_plusotherstuff2 (same key as in previous record,&lt;BR /&gt; because start date 20110402 is the endDate 20110401 + 1&lt;BR /&gt;&lt;BR /&gt;Thus keyValue binds together the continuous records.&lt;/P&gt;&lt;P&gt;T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2011 08:35:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-iterate-a-loaded-table-in-script-and-comapre-values/m-p/196171#M56358</guid>
      <dc:creator />
      <dc:date>2011-04-04T08:35:22Z</dc:date>
    </item>
    <item>
      <title>How can I iterate a loaded table in script and comapre values between lines/records?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-iterate-a-loaded-table-in-script-and-comapre-values/m-p/196172#M56359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you already try the inter-record functions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2011 08:44:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-iterate-a-loaded-table-in-script-and-comapre-values/m-p/196172#M56359</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-04-04T08:44:02Z</dc:date>
    </item>
    <item>
      <title>How can I iterate a loaded table in script and comapre values between lines/records?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-iterate-a-loaded-table-in-script-and-comapre-values/m-p/196173#M56360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Thanks. Inter-record Previous-function helps to some extent. But in my data&lt;BR /&gt;the chain of start and end dates can be long, say e.g. 10 records.&lt;BR /&gt;It's ok to write previous once or twice but previous(previous(previous(... no more&lt;BR /&gt;&lt;BR /&gt;How can I write in a more elegant way the following ugly deep if structure in load.&lt;BR /&gt;In addition to the day condition two other fields must match.&lt;BR /&gt;&lt;BR /&gt;if(field_1 &amp;lt;&amp;gt; previous(field_1), keyValue,&lt;BR /&gt;if(field_2 &amp;lt;&amp;gt; previous(field_2), keyValue,&lt;BR /&gt;if(startDate &amp;lt;&amp;gt; previous(endDate) + 1, keyValue,&lt;BR /&gt;&lt;BR /&gt;// 1st match backwards found. Any more?&lt;BR /&gt;&lt;BR /&gt;if(previous(field_1) &amp;lt;&amp;gt; previous(previous(field_1)), previous(keyValue),&lt;BR /&gt;if(previous(field_2) &amp;lt;&amp;gt; previous(previous(field_2)), previous(keyValue),&lt;BR /&gt;if(previous(startDate) &amp;lt;&amp;gt; previous(previous(endDate)) + 1, previous(keyValue),&lt;BR /&gt;&lt;BR /&gt;// 2nd match backwards found. Any more?&lt;BR /&gt;&lt;BR /&gt;if(previous(previous(field_1)) &amp;lt;&amp;gt; previous(previous(previous(field_1))), previous(previous(keyValue)),&lt;BR /&gt;if(previous(previous(field_2)) &amp;lt;&amp;gt; previous(previous(previous(field_2))), previous(previous(keyValue)),&lt;BR /&gt;if(previous(previous(startDate)) &amp;lt;&amp;gt; previous(previous(previous(endDate))) + 1, previous(previous(keyValue)),&lt;BR /&gt;&lt;BR /&gt;// 3rd match backwards found. But there can be more.&lt;BR /&gt;previous(previous(previous(keyValue))))))))))))&lt;BR /&gt;as newKeyValue,&lt;/P&gt;&lt;P&gt;T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2011 14:29:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-iterate-a-loaded-table-in-script-and-comapre-values/m-p/196173#M56360</guid>
      <dc:creator />
      <dc:date>2011-04-14T14:29:22Z</dc:date>
    </item>
  </channel>
</rss>

