<?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 Table modification in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Table-modification-in-script/m-p/148095#M26452</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try if this works:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD&lt;BR /&gt; Col1,&lt;BR /&gt;if(isnull(Col1), previous(Col1), Col1) as Col2&lt;BR /&gt;FROM xyz;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Col2 is the new field which will have nulls replaced with previous value in Col1.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Jul 2009 15:22:01 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-07-01T15:22:01Z</dc:date>
    <item>
      <title>Table modification in script</title>
      <link>https://community.qlik.com/t5/QlikView/Table-modification-in-script/m-p/148094#M26451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I was wondering if there's some way to modify the contents of a table after it has been loaded. If memory serves, QV9 adds some sort of insertion/update functionality but as I'm using QV8.5 that doesn't help much.&lt;/P&gt;&lt;P&gt;For an example let's say I have a table with only one field. Some of the rows have a null value and I'd like to replace those null values with the previous non-null value. So "1 2 NULL NULL 9 NULL 3" becomes "1 2 2 2 9 9 3" etc.&lt;/P&gt;&lt;P&gt;Is there any way to accomplish this efficiently? Currently I have a solution that creates a new table and inserts the rows one by one in a loop but generating the new rows like this is painfully slow.&lt;/P&gt;&lt;P&gt;Any help is much appreciated.&lt;/P&gt;&lt;P&gt;-Teemu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 14:53:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Table-modification-in-script/m-p/148094#M26451</guid>
      <dc:creator>teempi</dc:creator>
      <dc:date>2009-07-01T14:53:27Z</dc:date>
    </item>
    <item>
      <title>Table modification in script</title>
      <link>https://community.qlik.com/t5/QlikView/Table-modification-in-script/m-p/148095#M26452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try if this works:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD&lt;BR /&gt; Col1,&lt;BR /&gt;if(isnull(Col1), previous(Col1), Col1) as Col2&lt;BR /&gt;FROM xyz;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Col2 is the new field which will have nulls replaced with previous value in Col1.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 15:22:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Table-modification-in-script/m-p/148095#M26452</guid>
      <dc:creator />
      <dc:date>2009-07-01T15:22:01Z</dc:date>
    </item>
    <item>
      <title>Table modification in script</title>
      <link>https://community.qlik.com/t5/QlikView/Table-modification-in-script/m-p/148096#M26453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Teemu,&lt;/P&gt;&lt;P&gt;I was going to propose that you might use the Previous statement in a comparison, but then I remembered that Previous uses the source data (which may still have Nulls, so it is better to use Peek to compare against the actual last loaded value.&lt;/P&gt;&lt;P&gt;Something like this work for you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;SET NULLINTERPRET=*;&lt;BR /&gt;TempTable:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; F1, F2, F3, F4, F5&lt;BR /&gt; Test1, 1, 2, 3, 4&lt;BR /&gt; Test2, 5, *, *, 6&lt;BR /&gt; Test3, *, 7, *, *&lt;BR /&gt; Test4, *, *, 8, 9&lt;BR /&gt; Test5, *, *, 8, 9&lt;BR /&gt; Test6, *, *, 8, 9&lt;BR /&gt; Test7, *, *, 8, 9&lt;BR /&gt; Test8, *, *, 8, 9&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;RealTable:&lt;BR /&gt;Noconcatenate Load&lt;BR /&gt; F1,&lt;BR /&gt; If(IsNull(F2), Peek('F2',-1,'RealTable'), F2) As F2,&lt;BR /&gt; If(IsNull(F3), Peek('F3',-1,'RealTable'), F3) As F3,&lt;BR /&gt; If(IsNull(F4), Peek('F4',-1,'RealTable'), F4) As F4,&lt;BR /&gt; If(IsNull(F5), Peek('F5',-1,'RealTable'), F5) As F5&lt;BR /&gt;Resident TempTable;&lt;BR /&gt;Drop Table TempTable;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 15:39:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Table-modification-in-script/m-p/148096#M26453</guid>
      <dc:creator>stephencredmond</dc:creator>
      <dc:date>2009-07-01T15:39:18Z</dc:date>
    </item>
    <item>
      <title>Table modification in script</title>
      <link>https://community.qlik.com/t5/QlikView/Table-modification-in-script/m-p/148097#M26454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the answers! Stephen's one was just what I was looking for. I didn't realize you could also use peek like that on the table you're just loading. This solution seems very handy. Thanks again!&lt;/P&gt;&lt;P&gt;-Teemu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 16:15:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Table-modification-in-script/m-p/148097#M26454</guid>
      <dc:creator>teempi</dc:creator>
      <dc:date>2009-07-01T16:15:57Z</dc:date>
    </item>
  </channel>
</rss>

