These questions and others are answered in this Technical Brief.
This is must-to-read paper for all beginners, it's sad I had not one 1+ year ago! Thank you!
Please find my two cents, this is what personally I would add to the document:
1. Master Calendar - you only mention dates but for some tasks it's necessary to have time as well, i.e. either hours, minutes, seconds or some combinations ofthem (for instance, in retail we need to know average number of a store visitor per hour or even per each 15 minutes). That would be a good thing to make it clear to a reader.
2. Also I'd mention Previous() function which can be used in a condition over values of previous row of a source, whilst Peek() allows to do the same but over values of previous row already loaded into the associative database of QV. One reason to use Previous() is a necessity to build a condition over values which are not to be loaded into associative database but still are meaningful for algorithm.
3. Pages 12 and 13, step "B" - you use vMinDate and vMaxDate variables which are not defined, it's better to make a reference to page 7 for the definition.
The document in a whole is good enough even without all of these, though.
Glad you like it, and thanks for the feedback. I will gather some more feedback and then revise the document in a some weeks.
Updating of the docuemnt is up to you since the document does describe how to "generate missing data in QlikView" and it's not intended to describe modeling in a whole.
In case you start adding some additions into a specialized paper you risk to start describing The Universe
That saved me a night shift on a saturday evening. Exactly what I needed. Great stuff. Thanks a lot 😉
I stopped with this and your brief helped a lot.
This is GREAT! Thanks for putting this together.
I tried to replace NULL values in der field 'Wert" with the value of the above record and import the new values in the field 'wertneu' in the table 'result'. But now in 'wertneu' there is the same as in the 'wert'. Where is the mistake? I would be very happy, if somebody can help me. Thank you!
load * inline
Load Min(Date) as MinDate, Max(Date) as MaxDate resident TransactionTable;
Let vMinDate = Peek('MinDate',-1,'MinMaxDate')-1;
Let vMaxDate = Peek('MaxDate',-1,'MinMaxDate');
Drop Table MinMaxDate;
Year(Date) as Year,
Month (Date) as Month,
Day(Date) as Day;
Load Date(recno()+$(vMinDate)) as Date Autogenerate vMaxDate-vMinDate;
LOAD Date, FB, Wert,
if(isnull(Wert),Peek(Wert),Wert)as Wertneu resident TransactionTable
order by Date, FB, Wert;
You need to join the dates with the transaction table so that you "generate" all missing dates. See How to populate a sparsely populated field.
Further, you should probably use the following definition of Wertneu:
otherwise you will just get a value on the row below, and not on all empty rows.
Wonderful! Thank you very much, Henric Cronström! I have solved the problem.
Thanks heaps for this document. It succinctly defines the challenges, the use cases, and the solutions.