Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
maxsheva
Contributor 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.

2 Replies
vinieme12
Esteemed Contributor II

Re: Data Autogenerate

MVP
MVP

Re: Data Autogenerate



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;

Community Browser