<?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: Regarding comparing the current row with the next row data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995694#M338880</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_14428618692257407 jive_text_macro" jivemacro_uid="_14428618692257407"&gt;
&lt;P&gt;Temp:&lt;/P&gt;
&lt;P&gt;Load&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Productid,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; contractid,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date(Date#(startdate,'DD/M/YY')) as startdate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date(Date#(enddate,'DD/M/YY')) as enddate&lt;/P&gt;
&lt;P&gt;Inline&lt;/P&gt;
&lt;P&gt;[&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Productid, contractid, startdate, enddate&lt;/P&gt;
&lt;P&gt;&amp;nbsp; p1, c1, 25/1/15, 30/1/15&lt;/P&gt;
&lt;P&gt;&amp;nbsp; p1, c2, 27/1/15, 17/2/15&lt;/P&gt;
&lt;P&gt;&amp;nbsp; p1, c3, 15/2/15, 19/3/15&lt;/P&gt;
&lt;P&gt;&amp;nbsp; p1, c4, 22/3/15, 25/5/15&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Temp2:&lt;/P&gt;
&lt;P&gt;Load&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Productid,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; contractid,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; startdate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; enddate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if(Productid = Previous(Productid),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If(startdate &amp;lt; Previous(enddate), 'Overlapping','OK'),'NewContract') as TempFlag &lt;/P&gt;
&lt;P&gt;Resident Temp&lt;/P&gt;
&lt;P&gt;Order By Productid, contractid;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table Temp;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;/P&gt;
&lt;P&gt;Final:&lt;/P&gt;
&lt;P&gt;Load&lt;/P&gt;
&lt;P&gt;&amp;nbsp; *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If(TempFlag = 'NewContract' and enddate &amp;gt; Previous(startdate),'Overlapping',TempFlag) as FinalFlag&lt;/P&gt;
&lt;P&gt;Resident Temp2&lt;/P&gt;
&lt;P&gt;Order By Productid, contractid desc;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table Temp2;&lt;/P&gt;
&lt;P&gt;Drop Field TempFlag;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Sep 2015 18:57:55 GMT</pubDate>
    <dc:creator>MK_QSL</dc:creator>
    <dc:date>2015-09-21T18:57:55Z</dc:date>
    <item>
      <title>Regarding comparing the current row with the next row data</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995685#M338871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;Is there any way to compare the current row with the next row data in the script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like we can use peek() to compare with the previous row&amp;nbsp; but something for the current row with the next row.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiru&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 17:58:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995685#M338871</guid>
      <dc:creator />
      <dc:date>2015-09-21T17:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding comparing the current row with the next row data</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995686#M338872</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;in Qlikview we have the previous() or peek() function.&lt;/P&gt;&lt;P&gt;If you are looking for a corresponding next() function, unfortunately it does not exist, but you can sort your data in the table like needed and then use the previous function. This gives the same result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Patric&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 18:11:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995686#M338872</guid>
      <dc:creator>pamaxeed</dc:creator>
      <dc:date>2015-09-21T18:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding comparing the current row with the next row data</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995687#M338873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;reverse the sort order &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 18:13:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995687#M338873</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-09-21T18:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding comparing the current row with the next row data</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995688#M338874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your can use Previous/Peek Function with Resident Load and Order By your Fields in Descending Order&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 18:32:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995688#M338874</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-09-21T18:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding comparing the current row with the next row data</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995689#M338875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much for your reply guys and I sincerely appreciate your time. &lt;/P&gt;&lt;P&gt;I am not sure how sorting/reversing will handle my scenario.&lt;/P&gt;&lt;P&gt;I am using the below expression to compare the current product id with the previous row product id&amp;nbsp; and looking for date overlapping in their contracts periods .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(productid= Peek(productid),If([Contract Start Date] &amp;lt; Peek([Contract End Date]), 1, 0),0) As Overlapping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Productid, contractid,startdate,enddate&lt;/P&gt;&lt;P&gt;p1,c1,25/1/15,30/1/15&lt;/P&gt;&lt;P&gt;p1,c2,27/1/15,17/2/15&lt;/P&gt;&lt;P&gt;p1,c3,15/2/15,19/3/15&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting overlapping for contracts c2 and c3 but I also need it for contract c1 as well.&lt;/P&gt;&lt;P&gt;Any suggestions will be appreciated!&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 18:32:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995689#M338875</guid>
      <dc:creator />
      <dc:date>2015-09-21T18:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding comparing the current row with the next row data</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995690#M338876</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_14428610603093544 jive_text_macro" jivemacro_uid="_14428610603093544"&gt;
&lt;P&gt;Temp:&lt;/P&gt;
&lt;P&gt;Load&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Productid,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; contractid,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date(Date#(startdate,'DD/M/YY')) as startdate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date(Date#(enddate,'DD/M/YY')) as enddate&lt;/P&gt;
&lt;P&gt;Inline&lt;/P&gt;
&lt;P&gt;[&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Productid, contractid, startdate, enddate&lt;/P&gt;
&lt;P&gt;&amp;nbsp; p1, c1, 25/1/15, 30/1/15&lt;/P&gt;
&lt;P&gt;&amp;nbsp; p1, c2, 27/1/15, 17/2/15&lt;/P&gt;
&lt;P&gt;&amp;nbsp; p1, c3, 15/2/15, 19/3/15&lt;/P&gt;
&lt;P&gt;&amp;nbsp; p1, c4, 22/3/15, 25/5/15&lt;/P&gt;
&lt;P&gt;];&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;Load&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Productid,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; contractid,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; startdate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; enddate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if(Productid = Previous(Productid),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If(startdate &amp;lt; Previous(enddate), 'Overlapping','OK')) as Flag&lt;/P&gt;
&lt;P&gt;Resident Temp&lt;/P&gt;
&lt;P&gt;Order By Productid, contractid;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table Temp;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to display 'Overlapping' for c1 as well, use below expression for flag&lt;/P&gt;&lt;P&gt;if(Productid = Previous(Productid),&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(startdate &amp;lt; Previous(enddate), 'Overlapping','OK'),'NewContract') as Flag &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 18:44:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995690#M338876</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-09-21T18:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding comparing the current row with the next row data</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995691#M338877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;source:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;load * inline [ &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Productid, contractid,startdate,enddate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;p1,c1,25/1/15,30/1/15&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;p1,c3,15/2/15,19/3/15&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;p1,c2,27/1/15,17/2/15&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;p1,c4,27/1/16,17/2/16&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;p1,c4,27/3/16,17/4/16&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;p2,c1,25/1/15,30/1/15&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;p2,c3,15/2/15,19/3/15&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;p2,c2,27/1/15,17/2/15&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;p2,c4,27/1/16,17/2/16&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;p2,c4,27/3/16,17/4/16&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;p2,c4,27/5/16,17/7/16&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;p2,c4,27/6/16,17/8/16&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;final1:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NoConcatenate load &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; *,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; if(Productid=Peek(Productid) and startdate&amp;lt;=Peek(enddate),1,0) as FlagOverlapping&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident source&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;order by Productid, startdate;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP Table source;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;final2:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NoConcatenate load &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Productid, contractid,startdate,enddate,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; rangemax(FlagOverlapping, if(Productid=Peek(Productid) and enddate&amp;gt;=Peek(startdate),1,0)) as FlagOverlapping&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident final1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;order by Productid, startdate desc;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP Table final1;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 18:48:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995691#M338877</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-09-21T18:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding comparing the current row with the next row data</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995692#M338878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much and I sincerely appreciate your time Manish.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way we could make contract c1 also overlapping??&lt;/P&gt;&lt;P&gt;Because ,c2 get started before c1 ends for that product. &lt;/P&gt;&lt;P&gt;so I am looking for a solution like c1,c2,c3 as overlapping and c4 as ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiru&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 18:50:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995692#M338878</guid>
      <dc:creator />
      <dc:date>2015-09-21T18:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding comparing the current row with the next row data</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995693#M338879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you guys, I sincerely appreciate your time!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally got the one I wanted!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiru&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 18:57:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995693#M338879</guid>
      <dc:creator />
      <dc:date>2015-09-21T18:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding comparing the current row with the next row data</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995694#M338880</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_14428618692257407 jive_text_macro" jivemacro_uid="_14428618692257407"&gt;
&lt;P&gt;Temp:&lt;/P&gt;
&lt;P&gt;Load&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Productid,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; contractid,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date(Date#(startdate,'DD/M/YY')) as startdate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date(Date#(enddate,'DD/M/YY')) as enddate&lt;/P&gt;
&lt;P&gt;Inline&lt;/P&gt;
&lt;P&gt;[&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Productid, contractid, startdate, enddate&lt;/P&gt;
&lt;P&gt;&amp;nbsp; p1, c1, 25/1/15, 30/1/15&lt;/P&gt;
&lt;P&gt;&amp;nbsp; p1, c2, 27/1/15, 17/2/15&lt;/P&gt;
&lt;P&gt;&amp;nbsp; p1, c3, 15/2/15, 19/3/15&lt;/P&gt;
&lt;P&gt;&amp;nbsp; p1, c4, 22/3/15, 25/5/15&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Temp2:&lt;/P&gt;
&lt;P&gt;Load&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Productid,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; contractid,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; startdate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; enddate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if(Productid = Previous(Productid),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If(startdate &amp;lt; Previous(enddate), 'Overlapping','OK'),'NewContract') as TempFlag &lt;/P&gt;
&lt;P&gt;Resident Temp&lt;/P&gt;
&lt;P&gt;Order By Productid, contractid;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table Temp;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;/P&gt;
&lt;P&gt;Final:&lt;/P&gt;
&lt;P&gt;Load&lt;/P&gt;
&lt;P&gt;&amp;nbsp; *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If(TempFlag = 'NewContract' and enddate &amp;gt; Previous(startdate),'Overlapping',TempFlag) as FinalFlag&lt;/P&gt;
&lt;P&gt;Resident Temp2&lt;/P&gt;
&lt;P&gt;Order By Productid, contractid desc;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table Temp2;&lt;/P&gt;
&lt;P&gt;Drop Field TempFlag;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Sep 2015 18:57:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-comparing-the-current-row-with-the-next-row-data/m-p/995694#M338880</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-09-21T18:57:55Z</dc:date>
    </item>
  </channel>
</rss>

