Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Fill in missing records on load

Hello All,

I have a data table that I would like to upload into my qlikview app but I would like to fill in the missing MonthYear data with the next available Price and if their is no Next record then use the Last available record.  I have put an example of the RawData and an example of what the data should look like after it is loaded.  I want to start the data as of Today and create 12 MonthYear data points for each product.  My initial thought is to loop through the record set but I am having trouble figuring it out.

I really appreciate any help on this.  Thanks in advance.

RawData

productMonthYearPrice
abcMar-126.975
abcJun-126.5572
abcJul-126.456
abcAug-126.5056
abcNov-126.556
abcJan-137
xyzMar-1220
xyzJun-1221
xyzJul-1222
xyzAug-1223
xyzNov-1224
xyzJan-1325

UploadedData

productMonthYearPrice
abcJan-126.975
abcFeb-126.975
abcMar-126.975
abcApr-126.5572
abcMay-126.5572
abcJun-126.5572
abcJul-126.456
abcAug-126.5056
abcSep-126.556
abcOct-126.556
abcNov-126.556
abcDec-127
xyzJan-1220
xyzFeb-1220
xyzMar-1220
xyzApr-1221
xyzMay-1221
xyzJun-1221
xyzJul-1222
xyzAug-1223
xyzSep-1224
xyzOct-1224
xyzNov-1224
xyzDec-1225
13 Replies
sridhar240784
Creator III
Creator III

Ok, I have changed the scrip now.

We have the data till Jan2013 in your sample data. i have modified my vMax varibale to take data till this year end. so now the month from Feb2013 will take the data from Jan 2013 and fill the below rows automatically.

Let vMax = Num(YearEnd(Peek('MaxDate')));

Check out the new field created for this 'Price_Final_YearEnd'

Hope this helps you.

-Sridhar

Not applicable
Author

This works great.  Thank you for all your help. 

Not applicable
Author

Sridhar, I just noticed that the new Price_Final_YearEnd is not using the correct prices.  Price_Final is using correct prices but it does not go to the maxdate .  Please let me know

Thanks

sridhar240784
Creator III
Creator III

ha.., Just noticed, small change in Price_Final_YearEnd field calculation.

Your expression should be as follows.

if(product = previous(product) and Len(Price_Final) = 0,peek('Price_Final_YearEnd'),Price_Final) as Price_Final_YearEnd

Check the attached application.

Hope this helps you again

-Sridhar