<?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: Finding next populated field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Finding-next-populated-field/m-p/1815298#M1212966</link>
    <description>&lt;P&gt;Something is off in your script... I am seeing this... did you use this?&amp;nbsp;&lt;STRONG&gt;Order By order_id, dt desc;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sunny_talwar_0-1623772365626.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/56852i74426D13CBE8A3D7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sunny_talwar_0-1623772365626.png" alt="sunny_talwar_0-1623772365626.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Jun 2021 15:53:18 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2021-06-15T15:53:18Z</dc:date>
    <item>
      <title>Finding next populated field</title>
      <link>https://community.qlik.com/t5/QlikView/Finding-next-populated-field/m-p/1815210#M1212942</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;i am struggling with the following task: In the following example data sets I need to populate the field STATUS (in case its empty), with the (chronologically) next populated value in STATUS for a given %ORDER_ID:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xyz_1011_0-1623762395309.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/56839iD0B417612153B0E4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xyz_1011_0-1623762395309.png" alt="xyz_1011_0-1623762395309.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Meaning: For the first two records STATUS would be 'paid' (as per record #3); for record #5 the STATUS would be 'open' (as per record #6) etc&lt;/P&gt;&lt;P&gt;I tried loops, peek(), min() and different joins, but never came up with an accurate result. Any advise, hint and / or help would be much appreciated!&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 13:09:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Finding-next-populated-field/m-p/1815210#M1212942</guid>
      <dc:creator>xyz_1011</dc:creator>
      <dc:date>2021-06-15T13:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Finding next populated field</title>
      <link>https://community.qlik.com/t5/QlikView/Finding-next-populated-field/m-p/1815236#M1212945</link>
      <description>&lt;P&gt;What would be the STATUS for line 7 (will it be open or paid?) and line 10 (would it be paid or blank)?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 14:08:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Finding-next-populated-field/m-p/1815236#M1212945</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2021-06-15T14:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Finding next populated field</title>
      <link>https://community.qlik.com/t5/QlikView/Finding-next-populated-field/m-p/1815238#M1212946</link>
      <description>&lt;P&gt;Thanks for your feedback&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;! Line 7 would be 'paid' - as per the next following STATUS being 'paid'. Every STATUS of an order's last record stays as is - hence line 10 will be empty.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 14:15:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Finding-next-populated-field/m-p/1815238#M1212946</guid>
      <dc:creator>xyz_1011</dc:creator>
      <dc:date>2021-06-15T14:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Finding next populated field</title>
      <link>https://community.qlik.com/t5/QlikView/Finding-next-populated-field/m-p/1815281#M1212960</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table:
LOAD * INLINE [
    order_id, dt, status
    123, 03/30/2021
    123, 06/30/2021
    123, 09/30/2021, paid
    123, 12/30/2021, paid
    456, 03/30/2021
    456, 06/30/2021, open
    456, 09/30/2021
    456, 12/30/2021, paid
    456, 03/30/2022, paid
    456, 06/30/2022
];

FinalTable:
NoConcatenate
LOAD order_id,
	 dt,
	 If(order_id = Previous(order_id), If(Len(Trim(status)) = 0, Peek('status'), status), status) as status
Resident Table
Order By order_id, dt desc;

DROP Table Table;&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 15 Jun 2021 15:14:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Finding-next-populated-field/m-p/1815281#M1212960</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2021-06-15T15:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Finding next populated field</title>
      <link>https://community.qlik.com/t5/QlikView/Finding-next-populated-field/m-p/1815293#M1212965</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp; There is still something not proper. Record #5 shows a STATUS of 'paid' although the next record for this order is 'open'&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xyz_1011_0-1623771899869.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/56851i45198F9E0655DBAC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xyz_1011_0-1623771899869.png" alt="xyz_1011_0-1623771899869.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 15:45:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Finding-next-populated-field/m-p/1815293#M1212965</guid>
      <dc:creator>xyz_1011</dc:creator>
      <dc:date>2021-06-15T15:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Finding next populated field</title>
      <link>https://community.qlik.com/t5/QlikView/Finding-next-populated-field/m-p/1815298#M1212966</link>
      <description>&lt;P&gt;Something is off in your script... I am seeing this... did you use this?&amp;nbsp;&lt;STRONG&gt;Order By order_id, dt desc;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sunny_talwar_0-1623772365626.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/56852i74426D13CBE8A3D7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sunny_talwar_0-1623772365626.png" alt="sunny_talwar_0-1623772365626.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 15:53:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Finding-next-populated-field/m-p/1815298#M1212966</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2021-06-15T15:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Finding next populated field</title>
      <link>https://community.qlik.com/t5/QlikView/Finding-next-populated-field/m-p/1815362#M1212973</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;, it didnt work because of my local date &amp;amp; time settings. After formatting the date in dt properly, it seems to be working just fine. Thanks! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 04:07:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Finding-next-populated-field/m-p/1815362#M1212973</guid>
      <dc:creator>xyz_1011</dc:creator>
      <dc:date>2021-06-16T04:07:54Z</dc:date>
    </item>
  </channel>
</rss>

