Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
See why BI users voted Qlik #1 in 11 categories. GET REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist III
Specialist III

Generate missing dates

Hi Friends,

I have a data like below ,

  

NameDate
A13-Apr-17
B13-Jul-17
C13-Oct-17
D

13-Oct-18

Now i want to generate dates between the name values, like A should be repeated till June month and from July B will repeat till Sep and from Oct 2017 to Sep 2018 C should repeat.

Can you please tell how can i generate this in script.

4 Replies
Highlighted
Master II
Master II

This is specific to QlikView but may also work in Sense

Generating Missing Data In QlikView

Highlighted
Specialist III
Specialist III

Thanks, But i have already tried this, it generates the same dates from each of the value, but in my requirement, there is conditional dates generation.

Highlighted
Specialist III
Specialist III

hic‌ can you please comment on my question please ?

Highlighted

It is unclear to me if you want the periods to start and end at month starts, or at the dates listed in your table. But if I assume that you indeed want to use the dates listed, the following script will do the job:

// ===========================
SourceData:
Load  Name,
Date(Date#(Date,'DD-MMM-YY')) as DateInSourceData
Inline
[Name,Date
A,13-Apr-17
B,13-Jul-17
C,13-Oct-17
D,13-Oct-18]
;

tmpData:
Load
DateInSourceData as BeginDate,
Date(Floor(Peek(BeginDate)-0.0001)) as EndDate,
Name
Resident SourceData
Order By DateInSourceData Desc;

Dates:
Load
Date(BeginDate + IterNo() - 1) as Date,
*
Resident tmpData
While BeginDate + IterNo() - 1 <= EndDate;

Drop Table tmpData;

// ===========================

But if you instead want to use the month starts, you just change

DateInSourceData as BeginDate,

to

MonthStart(DateInSourceData) as BeginDate,

HIC