<?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 Populate missing Months in between and peek the previous month's  value for missing in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Populate-missing-Months-in-between-and-peek-the-previous-month-s/m-p/1756253#M453785</link>
    <description>&lt;P&gt;Hi Qlikers,&lt;/P&gt;&lt;P&gt;I have an interesting requirement where in I need to populate between missing months and also get the value of previous month's for the missing month.&lt;/P&gt;&lt;P&gt;Let's say, I have a table like this&lt;/P&gt;&lt;P&gt;Month, Amount&lt;/P&gt;&lt;P&gt;Jan, 85&lt;/P&gt;&lt;P&gt;Mar, 76&lt;/P&gt;&lt;P&gt;Oct,90&lt;/P&gt;&lt;P&gt;And My desired output would have to be like this&lt;/P&gt;&lt;P&gt;Month, Amount&lt;/P&gt;&lt;P&gt;Jan, 85&lt;/P&gt;&lt;P&gt;Feb,85&lt;/P&gt;&lt;P&gt;Mar, 76,&lt;/P&gt;&lt;P&gt;Apr,76&lt;/P&gt;&lt;P&gt;May,76&lt;/P&gt;&lt;P&gt;Jun,76&lt;/P&gt;&lt;P&gt;July,76&lt;/P&gt;&lt;P&gt;Aug,76&lt;/P&gt;&lt;P&gt;Sep,76&lt;/P&gt;&lt;P&gt;Oct,90&lt;/P&gt;&lt;P&gt;Could you please help me how to achieve the same.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prathip&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 17:54:55 GMT</pubDate>
    <dc:creator>prathipsrinivas</dc:creator>
    <dc:date>2024-11-16T17:54:55Z</dc:date>
    <item>
      <title>Populate missing Months in between and peek the previous month's  value for missing</title>
      <link>https://community.qlik.com/t5/QlikView/Populate-missing-Months-in-between-and-peek-the-previous-month-s/m-p/1756253#M453785</link>
      <description>&lt;P&gt;Hi Qlikers,&lt;/P&gt;&lt;P&gt;I have an interesting requirement where in I need to populate between missing months and also get the value of previous month's for the missing month.&lt;/P&gt;&lt;P&gt;Let's say, I have a table like this&lt;/P&gt;&lt;P&gt;Month, Amount&lt;/P&gt;&lt;P&gt;Jan, 85&lt;/P&gt;&lt;P&gt;Mar, 76&lt;/P&gt;&lt;P&gt;Oct,90&lt;/P&gt;&lt;P&gt;And My desired output would have to be like this&lt;/P&gt;&lt;P&gt;Month, Amount&lt;/P&gt;&lt;P&gt;Jan, 85&lt;/P&gt;&lt;P&gt;Feb,85&lt;/P&gt;&lt;P&gt;Mar, 76,&lt;/P&gt;&lt;P&gt;Apr,76&lt;/P&gt;&lt;P&gt;May,76&lt;/P&gt;&lt;P&gt;Jun,76&lt;/P&gt;&lt;P&gt;July,76&lt;/P&gt;&lt;P&gt;Aug,76&lt;/P&gt;&lt;P&gt;Sep,76&lt;/P&gt;&lt;P&gt;Oct,90&lt;/P&gt;&lt;P&gt;Could you please help me how to achieve the same.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prathip&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 17:54:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Populate-missing-Months-in-between-and-peek-the-previous-month-s/m-p/1756253#M453785</guid>
      <dc:creator>prathipsrinivas</dc:creator>
      <dc:date>2024-11-16T17:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Populate missing Months in between and peek the previous month's  value for missing</title>
      <link>https://community.qlik.com/t5/QlikView/Populate-missing-Months-in-between-and-peek-the-previous-month-s/m-p/1756288#M453787</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/10090"&gt;@prathipsrinivas&lt;/a&gt;&amp;nbsp; One solution:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Input:

load Date#('01/'&amp;amp;Month&amp;amp;'/2020','DD/MMM/YYYY') as Month,Amount 

inline [
Month, Amount
Jan, 85
Mar, 76
Oct,90
] ;

Tmp:
noconcatenate
load *,if(rowno()=1,Addmonths(Month,1),peek(Month)) as Start resident Input order by Month DESC;
 drop table Input;

Final:
noconcatenate
load Amount, month(monthstart(Month,iterno()-1)) as Month  resident Tmp  while monthstart(Month,iterno()-1)&amp;lt; Start; 


drop table Tmp;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to change inline [&lt;BR /&gt;Month, Amount&lt;BR /&gt;Jan, 85&lt;BR /&gt;Mar, 76&lt;BR /&gt;Oct,90&lt;BR /&gt;] ;&lt;/P&gt;&lt;P&gt;by From your database..&lt;/P&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: 282px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/43092iB271E98D6B3BE7B6/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>Tue, 27 Oct 2020 14:19:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Populate-missing-Months-in-between-and-peek-the-previous-month-s/m-p/1756288#M453787</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-10-27T14:19:54Z</dc:date>
    </item>
  </channel>
</rss>

