<?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: Derive New Field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516438#M1131384</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if(num(DateAndTime)&amp;gt;num(UpdatedDateandTime),0,1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Dec 2013 13:43:07 GMT</pubDate>
    <dc:creator>sivarajs</dc:creator>
    <dc:date>2013-12-02T13:43:07Z</dc:date>
    <item>
      <title>Derive New Field</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516437#M1131382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following table sorted by DateAndTime field and can be grouped by IDLOC column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="326"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" width="64"&gt;IDLOC&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="122"&gt;DateAndTime&lt;/TD&gt;&lt;TD class="xl67" style="border-left: none;" width="140"&gt;UpdatedDateandTime&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl68" height="17" style="border-top: none;"&gt;P01&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-top: none; border-left: none;"&gt;20131120080000&lt;/TD&gt;&lt;TD class="xl69" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl68" height="17" style="border-top: none;"&gt;P01&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-top: none; border-left: none;"&gt;20131120083000&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-top: none; border-left: none;"&gt;20131120150000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl68" height="17" style="border-top: none;"&gt;P01&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-top: none; border-left: none;"&gt;20131121090000&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl68" height="17" style="border-top: none;"&gt;P03&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-top: none; border-left: none;"&gt;20131201100000&lt;/TD&gt;&lt;TD class="xl69" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl68" height="17" style="border-top: none;"&gt;P03&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-top: none; border-left: none;"&gt;20131201140000&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-top: none; border-left: none;"&gt;20131202030000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl68" height="17" style="border-top: none;"&gt;P03&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-top: none; border-left: none;"&gt;20131201190000&lt;/TD&gt;&lt;TD class="xl69" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is I need to compare the UpdatedDateandTime with DateAndTime i.e. UpdatedDateandTime has to be&amp;nbsp; compared with &lt;/P&gt;&lt;P&gt;Previous(DateAndTime), DateAndTime and Next(DateAndTime)&amp;nbsp; for the same group IDLOC. Based on the comparision need to derive New Field indicating the Flag. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the UpdatedDateandTime is Greater Than DateAndTime then 1 else 0. After deriving the table will be as below. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="390"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" width="64"&gt;IDLOC&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="122"&gt;DateAndTime&lt;/TD&gt;&lt;TD class="xl67" style="border-left: none;" width="140"&gt;UpdatedDateandTime&lt;/TD&gt;&lt;TD class="xl67" style="border-left: none;" width="64"&gt;NewField&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl68" height="17" style="border-top: none;"&gt;P01&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-top: none; border-left: none;"&gt;20131120080000&lt;/TD&gt;&lt;TD class="xl69" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;TD class="xl70" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl68" height="17" style="border-top: none;"&gt;P01&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-top: none; border-left: none;"&gt;20131120083000&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-top: none; border-left: none;"&gt;20131120150000&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl68" height="17" style="border-top: none;"&gt;P01&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-top: none; border-left: none;"&gt;20131121090000&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;TD class="xl70" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl68" height="17" style="border-top: none;"&gt;P03&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-top: none; border-left: none;"&gt;20131201100000&lt;/TD&gt;&lt;TD class="xl69" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;TD class="xl70" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl68" height="17" style="border-top: none;"&gt;P03&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-top: none; border-left: none;"&gt;20131201140000&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-top: none; border-left: none;"&gt;20131202030000&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl68" height="17" style="border-top: none;"&gt;P03&lt;/TD&gt;&lt;TD align="right" class="xl69" style="border-top: none; border-left: none;"&gt;20131201190000&lt;/TD&gt;&lt;TD class="xl69" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;TD class="xl70" style="border-top: none; border-left: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&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;Regards,&lt;/P&gt;&lt;P&gt;Alvin. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 13:23:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516437#M1131382</guid>
      <dc:creator>alvinford</dc:creator>
      <dc:date>2013-12-02T13:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Derive New Field</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516438#M1131384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if(num(DateAndTime)&amp;gt;num(UpdatedDateandTime),0,1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 13:43:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516438#M1131384</guid>
      <dc:creator>sivarajs</dc:creator>
      <dc:date>2013-12-02T13:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Derive New Field</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516439#M1131385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First convert your date fields into Timestamps and then compare. Please try like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF(NUM(TIMESTAMP#(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.727272033691406px;"&gt;DateAndTime&lt;/SPAN&gt;,'YYYYMMDDhhmmss')) &amp;gt; NUM(TIMESTAMP#(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.727272033691406px;"&gt;UpdatedDateandTime&lt;/SPAN&gt;,'YYYYMMDDhhmmss')) , 0 ,1) AS NewField&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 14:04:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516439#M1131385</guid>
      <dc:creator />
      <dc:date>2013-12-02T14:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Derive New Field</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516440#M1131387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dathu, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to compare with the Previous and Next&amp;nbsp; and Same row , if I do as suggested by you , it will only compare the same row. Which is not my requirement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alvin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 14:13:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516440#M1131387</guid>
      <dc:creator>alvinford</dc:creator>
      <dc:date>2013-12-02T14:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Derive New Field</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516441#M1131388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can to use the functions "below" and "above" for to valuate the preceeding and following row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ciro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 14:20:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516441#M1131388</guid>
      <dc:creator />
      <dc:date>2013-12-02T14:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Derive New Field</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516442#M1131390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;You can use previous function in Script&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(Num(TIMESTAMP#(UpdatedDateandTime,'YYYYMMDDhhmmss'))=Previous(NUM(TIMESTAMP#(DateAndTime,'YYYYMMDDhhmmss'))),1,0) as NewField&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 14:21:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516442#M1131390</guid>
      <dc:creator>saumyashah90</dc:creator>
      <dc:date>2013-12-02T14:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Derive New Field</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516443#M1131391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hi Saumya&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I want to compare with the Previous and Next&amp;nbsp; and Same row , if I do as suggested by you , it will only compare the same row. Which is not my requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Regards,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Alvin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 14:44:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516443#M1131391</guid>
      <dc:creator>alvinford</dc:creator>
      <dc:date>2013-12-02T14:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Derive New Field</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516444#M1131392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please, see the attachment&lt;BR /&gt;I hope reply your problem with solution...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 15:24:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516444#M1131392</guid>
      <dc:creator />
      <dc:date>2013-12-02T15:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Derive New Field</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516445#M1131393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ciro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your valuable reply. The solution which you have provided is correct, but i want to perform at the script level as I want to use the field for other calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alvin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 16:07:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516445#M1131393</guid>
      <dc:creator>alvinford</dc:creator>
      <dc:date>2013-12-02T16:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Derive New Field</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516446#M1131394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, see now the attachment...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 16:42:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516446#M1131394</guid>
      <dc:creator />
      <dc:date>2013-12-02T16:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Derive New Field</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516447#M1131395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please find the attached application:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;load IDLOC, Num(Timestamp#(DATE_TIME,'YYYYMMDDhhmm')) AS DATE_TIME, Num(Timestamp#(UPDATE_TIME,'YYYYMMDDhhmm')) AS UPDATE_TIME&lt;/P&gt;&lt;P&gt;inline [&lt;/P&gt;&lt;P&gt;IDLOC,DATE_TIME, UPDATE_TIME&lt;/P&gt;&lt;P&gt;P01,201311200800,&lt;/P&gt;&lt;P&gt;P01,201311200830,201311201500&lt;/P&gt;&lt;P&gt;P01,201311210900,&lt;/P&gt;&lt;P&gt;P02,201312011000,&lt;/P&gt;&lt;P&gt;P02,201312011400,201312020300&lt;/P&gt;&lt;P&gt;P02,201312011900,&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;Left Join (DATA)&lt;/P&gt;&lt;P&gt;LOAD IDLOC, IF(Max(UPDATE_TIME) &amp;gt; Max(DATE_TIME) ,0,1) AS FLAG&lt;/P&gt;&lt;P&gt;Resident DATA Group by IDLOC;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 17:06:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516447#M1131395</guid>
      <dc:creator />
      <dc:date>2013-12-02T17:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Derive New Field</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516448#M1131396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ciro , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once again thanks for your valuable reply. I think I have to modify my query i.e. I have the following records &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="390"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="17" width="64"&gt;RowNo&lt;/TD&gt;&lt;TD class="xl65" width="64"&gt;IDLOC&lt;/TD&gt;&lt;TD class="xl68" width="122"&gt;DateAndTime&lt;/TD&gt;&lt;TD class="xl69" width="140"&gt;UpdatedDateandTime&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;1&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none;"&gt;P01&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131120080000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;2&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none;"&gt;P01&lt;/TD&gt;&lt;TD align="right" class="xl67"&gt;20131120083000&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131120150000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;3&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none;"&gt;P01&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131121090000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;4&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none;"&gt;P01&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131121120000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;5&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none;"&gt;P03&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131201100000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;6&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none;"&gt;P03&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131201140000&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131202030000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;7&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none;"&gt;P03&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131201190000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;8&lt;/TD&gt;&lt;TD class="xl71"&gt;PO3&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131201230000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;for the IDLOC PO1 i have to compare the RowNo 2 with 1 and 3 and maintain a flag at RowNo 2 and same for the IDLOC PO3 I need to compare RowNo 6 with 5 and 7 and maintain the Flag in 6. Which will be as below &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="454"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="17" width="64"&gt;RowNo&lt;/TD&gt;&lt;TD class="xl65" width="64"&gt;IDLOC&lt;/TD&gt;&lt;TD class="xl68" width="122"&gt;DateAndTime&lt;/TD&gt;&lt;TD class="xl69" width="140"&gt;UpdatedDateandTime&lt;/TD&gt;&lt;TD class="xl69" width="64"&gt;NewField&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;1&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none;"&gt;P01&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131120080000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;2&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none;"&gt;P01&lt;/TD&gt;&lt;TD align="right" class="xl67"&gt;20131120083000&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131120150000&lt;/TD&gt;&lt;TD align="right"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;3&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none;"&gt;P01&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131121090000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;4&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none;"&gt;P01&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131121120000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;5&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none;"&gt;P03&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131201100000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;6&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none;"&gt;P03&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131201140000&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131202030000&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;7&lt;/TD&gt;&lt;TD class="xl70" style="border-top: none;"&gt;P03&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131201190000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;8&lt;/TD&gt;&lt;TD class="xl71"&gt;PO3&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;20131201230000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alvin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2013 01:52:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516448#M1131396</guid>
      <dc:creator>alvinford</dc:creator>
      <dc:date>2013-12-03T01:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Derive New Field</title>
      <link>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516449#M1131397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, with my script you compare each line for each IDLOC with the same value of DAtaAndTime (replicate on each line for the join) , the result is a NewField with value for each line, if you want to have a single value on the same line of UpdateDateandTime , i think is necessary another load .....resident.... with a condition i.e.:IF (LEN(UpdatDAteandTime)&amp;gt;1,NewField) and you obtain value for NewField only on the row where ther is the value of UpdateDateandTIme.&lt;BR /&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2013 08:26:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Derive-New-Field/m-p/516449#M1131397</guid>
      <dc:creator />
      <dc:date>2013-12-03T08:26:02Z</dc:date>
    </item>
  </channel>
</rss>

