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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
suzel404
Creator
Creator

How to identify and create period missing ?

Hi all,

How can I identify and create missing period?

  

IDStartEnd
117/08/201618/06/2016
118/06/201620/10/2016
-9920/01/201601/11/2016
101/11/201631/12/2016
-9931/12/201602/03/2017
102/01/201703/03/2017

Thanks for your help.

4 Replies
sunny_talwar

May be something like this:

Table:

LOAD * Inline [

ID, Start, End

1, 17/04/2016, 18/06/2016

1, 18/06/2016, 20/10/2016

1, 01/11/2016, 31/12/2016

1, 02/01/2017, 03/03/2017

];

Temp:

LOAD *,

  If(RowNo() > 1, If(Peek('End') = Start, 1, 0)) as Flag,

  If(RowNo() > 1, If(Peek('End') = Start, Null(), Peek('End'))) as NewStart,

  Start as NewEnd

Resident Table

Order By ID, Start;

Concatenate(Table)

LOAD -99 as ID,

  NewStart as Start,

  NewEnd as End

Resident Temp

Where Flag = 0;

DROP Table Temp;


Capture.PNG

suzel404
Creator
Creator
Author

Hi Sunny,

I tried with my data but I have null Mark_ID.

Can you help me ?

Thanks

sunny_talwar

I will check this at a later point today.

Best,

Sunny