<?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: Replace null/Zero values with previous value in Water Cooler</title>
    <link>https://community.qlik.com/t5/Water-Cooler/Replace-null-Zero-values-with-previous-value/m-p/1731492#M11599</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/101166"&gt;@Sowmya_Srinivasan&lt;/a&gt;&amp;nbsp;Are you using QlikView or Qlik Sense? I would like to move this into the correct product forum. Thank you.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jul 2020 18:58:07 GMT</pubDate>
    <dc:creator>Sue_Macaluso</dc:creator>
    <dc:date>2020-07-28T18:58:07Z</dc:date>
    <item>
      <title>Replace null/Zero values with previous value</title>
      <link>https://community.qlik.com/t5/Water-Cooler/Replace-null-Zero-values-with-previous-value/m-p/1730518#M11574</link>
      <description>&lt;P&gt;I have the following scenario.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sowmya_Srinivasan_0-1595571104446.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37995iBB6B81601C25E1DE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sowmya_Srinivasan_0-1595571104446.png" alt="Sowmya_Srinivasan_0-1595571104446.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have year month and score as two columns. For certain year month, the score values are either zero or null. When the score value is zero or null for a particular year month i am expected to get the previous score value greater than zero.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example: For 2020008 and 2020009 the score values are zero i am expected to fill the rows with 90 which is the previous score value. I need the resultant table to look like this.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sowmya_Srinivasan_1-1595571386667.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/38006i29D107378091A8F6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sowmya_Srinivasan_1-1595571386667.png" alt="Sowmya_Srinivasan_1-1595571386667.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;First two records should be zero because the scoring started only from 2020003.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note: I need to do the changes&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;at the back end.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 06:19:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Water-Cooler/Replace-null-Zero-values-with-previous-value/m-p/1730518#M11574</guid>
      <dc:creator>Sowmya_Srinivasan</dc:creator>
      <dc:date>2020-07-24T06:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Replace null/Zero values with previous value</title>
      <link>https://community.qlik.com/t5/Water-Cooler/Replace-null-Zero-values-with-previous-value/m-p/1730553#M11575</link>
      <description>&lt;P&gt;Maye be this :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;load Date,if(rowno()=1,0,if(IsNull(Score),peek(Score),Score)) as Score ;
load Date,if(Score &amp;lt;&amp;gt;0 and len(trim(Score))&amp;gt;0,Score) as Score   inline [
Date,Score
202001,
202002,0
202003,83
202004,0
202005,0
202006,
202007,90
202008,0
202009,0
2020010,92
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 335px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/38008iCC0A98985F38EEAB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 08:27:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Water-Cooler/Replace-null-Zero-values-with-previous-value/m-p/1730553#M11575</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-07-24T08:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Replace null/Zero values with previous value</title>
      <link>https://community.qlik.com/t5/Water-Cooler/Replace-null-Zero-values-with-previous-value/m-p/1731492#M11599</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/101166"&gt;@Sowmya_Srinivasan&lt;/a&gt;&amp;nbsp;Are you using QlikView or Qlik Sense? I would like to move this into the correct product forum. Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 18:58:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Water-Cooler/Replace-null-Zero-values-with-previous-value/m-p/1731492#M11599</guid>
      <dc:creator>Sue_Macaluso</dc:creator>
      <dc:date>2020-07-28T18:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Replace null/Zero values with previous value</title>
      <link>https://community.qlik.com/t5/Water-Cooler/Replace-null-Zero-values-with-previous-value/m-p/1731532#M11600</link>
      <description>&lt;P&gt;Date format looks weird but try to convert it in proper format. Because you first need to order your data otherwise peek and previous logic won't work properly. Try below&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Data:
LOAD date#(Left(Date,4)&amp;amp;right(Date,2),'YYYYMM') as Date,Score;
load * inline [
Date,Score
2020001,
2020002,0
2020003,83
2020004,0
2020005,0
2020006,
2020007,90
2020008,0
2020009,0
2020010,92
];

New:
NoConcatenate
LOAD Date,
     rangesum(if(Score&amp;gt;0, Score,if((len(trim(Score))=0 or Score=0) and Peek(Score)&amp;gt;0,Peek(Score),Peek(Score)))) as Score
Resident Data
Order by Date;

DROP Table Data;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 21:58:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Water-Cooler/Replace-null-Zero-values-with-previous-value/m-p/1731532#M11600</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-07-28T21:58:53Z</dc:date>
    </item>
  </channel>
</rss>

