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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
maxsheva
Creator II
Creator II

Data Autogenerate

Hi,

Table1:

LOAD * INLINE [

Example, Date, Value1, Value2

Example1, 01/02/2017, 70, 70

Example1, 01/04/2017, 80, 80

Example1, 01/07/2017, 50, 30

Example1, 01/09/2017, 30, 50

];

How can I generate missing dates with values?

As result I need:

Table1:

LOAD * INLINE [

Example, Date, Value1, Value2

Example1, 01/02/2017, 70, 70

Example1, 01/03/2017, 70, 70

Example1, 01/04/2017, 80, 80

Example1, 01/05/2017, 80, 80

Example1, 01/06/2017, 80, 80

Example1, 01/07/2017, 50, 30

Example1, 01/08/2017, 50, 30

Example1, 01/09/2017, 30, 50

];

Thx.

Labels (1)
2 Replies
vinieme12
Champion III
Champion III

Here is your answer

How to populate a sparsely populated field

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
maxgro
MVP
MVP



SET DateFormat='MM/DD/YYYY';

// I added some test data, Example2

Table1:

LOAD * INLINE [

Example, Date, Value1, Value2

Example1, 01/02/2017, 70, 70

Example1, 01/04/2017, 80, 80

Example1, 01/07/2017, 50, 30

Example1, 01/09/2017, 30, 50

Example2, 01/04/2017, 70, 70

Example2, 02/04/2017, 80, 80

];

tmp:

LOAD

  Example,

  Date(min(Date)) as MinDate,

  Date(max(Date)) as MaxDate

Resident Table1

Group By Example;

Join (Table1)

LOAD

  Example,

  Date(MinDate + IterNo() -1) as Date

Resident tmp

While Date(MinDate + IterNo() -1) <= MaxDate;

DROP Table tmp;

Table2:

NoConcatenate LOAD

  Example, Date,

  Alt(Value1, Peek('Value1')) as Value1,

  Alt(Value2, Peek('Value2')) as Value2

Resident Table1

Order By Example, Date;

DROP Table Table1;