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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
surajap123
Creator III
Creator III

peek and generate missing

Hi Experts,

My Source data doesn't have sales for all the months.Eg- The sales only happened in Jan and March.
The below script works to copy the sales of above month into the below month, which is fine.
Now my requirement is to populate sales for month Feb(Note that Feb month is never present in source data). So likewise sales should be propulated for all missing months in between. I am not getting clue how to achieve this.

Data:
LOAD *,Product & '|'& Month(Date) as key
INLINE [
Product, Date, Sales, Country
Pen, 01/01/2017, 10, UK
Pen, 02/01/2017, 10, UK
Pencil, 01/01/2017, 10, US
Pencil, 02/01/2017, 10, UK 
Pen, 01/03/2017, 10, US
Pen, 02/03/2017, 10, UK
Pencil, 01/03/2017, , US
Pencil, 02/03/2017, , UK
]
;


AggrData:
LOAD Product & '|'& Month(Date) as key,
Product as Pd,
Month(Date) as Month,
if(sum(Sales)=0, If(Peek('Pd')= Product,Peek('AggrSales')),sum(Sales)) as AggrSales
Resident Data
Group by
Month(Date),Product
Order by Product, Date;

current ouput-

Expected ouput-

Please help!

3 Replies
avinashelite

You don't have the date for FEB and hence its not showing

avinashelite

If you want to generate the missing dates then you need to use calendar ..check this

Fill in missing dates till today

Generate missing Dates

Generating Missing Data In QlikView

surajap123
Creator III
Creator III
Author

Hi Avinash,

I tried the below thread that you gave, but still struggling to achieve the result, as I am not sure how to generate calendar using month in my AggrData table.

Generate missing Dates

Please help!