Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
DoctorPolidori
Contributor III
Contributor III

function that returns date for the Sunday of the week  input date belongs to

LOAD script question:

Given a date e.g. ‘2024-01-18’ I need a function that returns a date for the Sunday of the week my input date belongs to.

getSundayDate(‘2024-01-08’) should return ‘2024-01-14’ i.e. Sunday date of that week
getSundayDate(‘2024-01-18’) should return  ‘2024-01-21’

Labels (1)
1 Solution

Accepted Solutions
DoctorPolidori
Contributor III
Contributor III
Author

 WeekEnd (script and chart function)
weekend - script and chart function | Qlik Sense on Windows Help

Example:

if(IsNull(queue_exit), Floor(WeekEnd([queue_enter_time]))-Floor([queue_enter_time]), if(Floor([queue_exit])-Floor([KO_STARTTID])>7,7,Floor([queue_exit])-Floor([queue_enter_time]))  ) AS days_in_queue_that_week

View solution in original post

1 Reply
DoctorPolidori
Contributor III
Contributor III
Author

 WeekEnd (script and chart function)
weekend - script and chart function | Qlik Sense on Windows Help

Example:

if(IsNull(queue_exit), Floor(WeekEnd([queue_enter_time]))-Floor([queue_enter_time]), if(Floor([queue_exit])-Floor([KO_STARTTID])>7,7,Floor([queue_exit])-Floor([queue_enter_time]))  ) AS days_in_queue_that_week