Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Gartner® Magic Quadrant™: 15 YEARS A LEADER - GET THE REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
beck_bakytbek
Master
Master

Extend time lapse

Hello colleagues,

I have a question, my data looks like this,

Start,  End
01.05.2022,  23.12.2022

Employee has worked until 23.12.2022 and from 24.12.2022 he is no longer in the company,
I would like to display the following time history:

01.01.2022 - present
02.01.2022 - present
....
23.12.2022- present
24.12.2022 - no longer present
25.12.2022 - no longer present
26.12.2022 - no longer present
27.12.2022 - no longer present
28.12.2022 - no longer present
29.12.2022 -no longer present
30.12.2022 - no longer present
31.12.2022 -no longer present

I would like to extend here only the period from 24.12.2022 to the end of the month: 31.12.2022.

i tried to solve this case using the function: IterNo(), but did not get a desired result.
Does anyone have an idea how to solve this case?

 

Thanks a lot for your help and feedback

Bek

Labels (1)
2 Replies
SerhanKaraer
Creator III
Creator III

Hello beck_bakytbek,

You have to manipulate the while loop check with monthend function.

SET DateFormat='DD.MM.YYYY';

LOAD Date(Start + IterNo()) as date, if(Start + IterNo() <= End, 'present', 'leave') as status
	WHILE Start + IterNo() <= MonthEnd(End);
LOAD * INLINE [
Start,  End
01.12.2022,  23.12.2022
];

exit Script;

 I hope it solves your issue.

beck_bakytbek
Master
Master
Author

Hello @SerhanKaraer 

first of all thanks a lot for your help and time, i will implement this solution and will let you know if it worked.

Thanks a lot