<?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: Populate Missing Data for all Materials in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Populate-Missing-Data-for-all-Materials/m-p/1858810#M70895</link>
    <description>&lt;P&gt;Instead of hard coding the year and months you should find a way to generate a table that contains all you desires year and month combinations. Basically all month and year combinations between your min period and max period. You also need to figure out a way to ensure that you read your joined table in a chronological order (thats why I created YearMonth in my example).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Nov 2021 15:39:50 GMT</pubDate>
    <dc:creator>Vegar</dc:creator>
    <dc:date>2021-11-12T15:39:50Z</dc:date>
    <item>
      <title>Populate Missing Data for all Materials</title>
      <link>https://community.qlik.com/t5/App-Development/Populate-Missing-Data-for-all-Materials/m-p/1858055#M70830</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my datasource, there are materials against which the month, year and stock are visible. In this datasource, if there is no change in stock over a particular month, then no new row is created for that missing month.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The smaller table shows how the datasource looks like. The larger table is how it should look like. If a month is missing, I need to replicate the data from the previous month to the current month. Like Feb data is used as the value for the missing Mar month.&lt;/P&gt;
&lt;P&gt;PS:&amp;nbsp; This same material can have the same issue across multiple years and regions.&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 240pt;" border="0" width="320" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 14.5pt;"&gt;
&lt;TD width="66.956px" height="19" style="height: 14.5pt; width: 48pt;"&gt;Material&lt;/TD&gt;
&lt;TD width="63.4607px" style="width: 48pt;"&gt;Region&lt;/TD&gt;
&lt;TD width="63.2292px" style="width: 48pt;"&gt;Month&lt;/TD&gt;
&lt;TD width="62.3611px" style="width: 48pt;"&gt;Year&lt;/TD&gt;
&lt;TD width="62.9861px" style="width: 48pt;"&gt;Stock&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.5pt;"&gt;
&lt;TD width="66.956px" height="19" align="right" style="height: 14.5pt;"&gt;1111111&lt;/TD&gt;
&lt;TD width="63.4607px"&gt;EMEA&lt;/TD&gt;
&lt;TD width="63.2292px" align="right"&gt;1&lt;/TD&gt;
&lt;TD width="62.3611px" align="right"&gt;2021&lt;/TD&gt;
&lt;TD width="62.9861px" align="right"&gt;10000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.5pt;"&gt;
&lt;TD width="66.956px" height="19" align="right" style="height: 14.5pt;"&gt;1111111&lt;/TD&gt;
&lt;TD width="63.4607px"&gt;EMEA&lt;/TD&gt;
&lt;TD width="63.2292px" align="right"&gt;2&lt;/TD&gt;
&lt;TD width="62.3611px" align="right"&gt;2021&lt;/TD&gt;
&lt;TD width="62.9861px" align="right"&gt;23000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.5pt;"&gt;
&lt;TD width="66.956px" height="19" align="right" style="height: 14.5pt;"&gt;1111111&lt;/TD&gt;
&lt;TD width="63.4607px"&gt;EMEA&lt;/TD&gt;
&lt;TD width="63.2292px" align="right"&gt;4&lt;/TD&gt;
&lt;TD width="62.3611px" align="right"&gt;2021&lt;/TD&gt;
&lt;TD width="62.9861px" align="right"&gt;19000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.5pt;"&gt;
&lt;TD width="66.956px" height="19" align="right" style="height: 14.5pt;"&gt;1111111&lt;/TD&gt;
&lt;TD width="63.4607px"&gt;EMEA&lt;/TD&gt;
&lt;TD width="63.2292px" align="right"&gt;5&lt;/TD&gt;
&lt;TD width="62.3611px" align="right"&gt;2021&lt;/TD&gt;
&lt;TD width="62.9861px" align="right"&gt;2000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.5pt;"&gt;
&lt;TD width="66.956px" height="19" align="right" style="height: 14.5pt;"&gt;1111111&lt;/TD&gt;
&lt;TD width="63.4607px"&gt;EMEA&lt;/TD&gt;
&lt;TD width="63.2292px" align="right"&gt;7&lt;/TD&gt;
&lt;TD width="62.3611px" align="right"&gt;2021&lt;/TD&gt;
&lt;TD width="62.9861px" align="right"&gt;14000&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 240pt;" border="0" width="320" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 14.5pt;"&gt;
&lt;TD width="64" height="19" style="height: 14.5pt; width: 48pt;"&gt;Material&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;Region&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;Month&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;Year&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;Stock&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.5pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.5pt;"&gt;1111111&lt;/TD&gt;
&lt;TD&gt;EMEA&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;2021&lt;/TD&gt;
&lt;TD align="right"&gt;10000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.5pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.5pt;"&gt;1111111&lt;/TD&gt;
&lt;TD&gt;EMEA&lt;/TD&gt;
&lt;TD align="right"&gt;2&lt;/TD&gt;
&lt;TD align="right"&gt;2021&lt;/TD&gt;
&lt;TD align="right"&gt;23000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.5pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.5pt;"&gt;1111111&lt;/TD&gt;
&lt;TD&gt;EMEA&lt;/TD&gt;
&lt;TD align="right"&gt;3&lt;/TD&gt;
&lt;TD align="right"&gt;2021&lt;/TD&gt;
&lt;TD align="right"&gt;23000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.5pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.5pt;"&gt;1111111&lt;/TD&gt;
&lt;TD&gt;EMEA&lt;/TD&gt;
&lt;TD align="right"&gt;4&lt;/TD&gt;
&lt;TD align="right"&gt;2021&lt;/TD&gt;
&lt;TD align="right"&gt;19000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.5pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.5pt;"&gt;1111111&lt;/TD&gt;
&lt;TD&gt;EMEA&lt;/TD&gt;
&lt;TD align="right"&gt;5&lt;/TD&gt;
&lt;TD align="right"&gt;2021&lt;/TD&gt;
&lt;TD align="right"&gt;2000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.5pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.5pt;"&gt;1111111&lt;/TD&gt;
&lt;TD&gt;EMEA&lt;/TD&gt;
&lt;TD align="right"&gt;6&lt;/TD&gt;
&lt;TD align="right"&gt;2021&lt;/TD&gt;
&lt;TD align="right"&gt;2000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.5pt;"&gt;
&lt;TD height="19" align="right" style="height: 14.5pt;"&gt;1111111&lt;/TD&gt;
&lt;TD&gt;EMEA&lt;/TD&gt;
&lt;TD align="right"&gt;7&lt;/TD&gt;
&lt;TD align="right"&gt;2021&lt;/TD&gt;
&lt;TD align="right"&gt;14000&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 09:27:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Populate-Missing-Data-for-all-Materials/m-p/1858055#M70830</guid>
      <dc:creator>gauravs275</dc:creator>
      <dc:date>2021-11-11T09:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Populate Missing Data for all Materials</title>
      <link>https://community.qlik.com/t5/App-Development/Populate-Missing-Data-for-all-Materials/m-p/1858067#M70831</link>
      <description>&lt;P&gt;This is a fairly common question - have a look at Henric's great explanation for it here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/How-to-populate-a-sparsely-populated-field/ba-p/1470637" target="_blank" rel="noopener"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/How-to-populate-a-sparsely-populated-field/ba-p/1470637&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-Documents/Generating-Missing-Data-In-QlikView/ta-p/1491394" target="_blank" rel="noopener"&gt;https://community.qlik.com/t5/QlikView-Documents/Generating-Missing-Data-In-QlikView/ta-p/1491394&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 09:48:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Populate-Missing-Data-for-all-Materials/m-p/1858067#M70831</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-11-11T09:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Populate Missing Data for all Materials</title>
      <link>https://community.qlik.com/t5/App-Development/Populate-Missing-Data-for-all-Materials/m-p/1858071#M70832</link>
      <description>&lt;P&gt;Try to do something like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Let vL.startyear =2021;
Let vL.noOfMonths = 24;

TMP_Fulltrans:
LOAD *,
  monthname(MakeDate(Year, Month)) as YearMonth,
;
LOAD
  MOD( iterno()-1,12)+1 as Month,
  $(vL.startyear)+Div(iterno()-0.5,12) as Year
AutoGenerate 1
While 
  iterno() &amp;lt;= $(vL.noOfMonths)
;


LEFT JOIN LOAD * INLINE [
Material, Region, Month, Year, Stock
1111111, EMEA, 1, 2021, 10000
1111111, EMEA, 2, 2021, 23000
1111111, EMEA, 4, 2021, 19000
1111111, EMEA, 5, 2021, 2000
1111111, EMEA, 7, 2021, 14000
];

Fulltrans:
NoConcatenate LOAD 
  IF(isnull(Material), Peek('Material'), Material) as Material, 
  IF(isnull(Region), Peek('Region'), Region) as Region, 
  IF(isnull(Stock), Peek('Stock'), Stock) as Stock, 
  Month, 
  Year
Resident TMP_Fulltrans
Order By YearMonth
;
Drop field YearMonth;
DROP table TMP_Fulltrans;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 11 Nov 2021 09:59:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Populate-Missing-Data-for-all-Materials/m-p/1858071#M70832</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2021-11-11T09:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Populate Missing Data for all Materials</title>
      <link>https://community.qlik.com/t5/App-Development/Populate-Missing-Data-for-all-Materials/m-p/1858490#M70862</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/25001"&gt;@Vegar&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your answer.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately the data I am working with starts from 2015 and as per your suggested method, hardcoding the number of months is not an option I can use.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please instruct me on how I can modify your solution to suit my requirements.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Gaurav&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 05:32:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Populate-Missing-Data-for-all-Materials/m-p/1858490#M70862</guid>
      <dc:creator>gauravs275</dc:creator>
      <dc:date>2021-11-12T05:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Populate Missing Data for all Materials</title>
      <link>https://community.qlik.com/t5/App-Development/Populate-Missing-Data-for-all-Materials/m-p/1858810#M70895</link>
      <description>&lt;P&gt;Instead of hard coding the year and months you should find a way to generate a table that contains all you desires year and month combinations. Basically all month and year combinations between your min period and max period. You also need to figure out a way to ensure that you read your joined table in a chronological order (thats why I created YearMonth in my example).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 15:39:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Populate-Missing-Data-for-all-Materials/m-p/1858810#M70895</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2021-11-12T15:39:50Z</dc:date>
    </item>
  </channel>
</rss>

