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: 
Not applicable

Need WeekEnd Friday, instead of Sunday

I'm trying to create a field within my load script for "Week Ending" where our weeks end at the end of every Friday.

I'm able to use the WeekEnd function and get a "Week Ending"  date in my tables using the following load statement, but it returns the standard "Week Ending" date of end of every Sunday.  Does anyone know how I can modify the script to subtract 2 days to get my weeks to end on Friday?

This is the load statement that has worked for me so far to get Week Ending as of end of Sunday:

date(WeekEnd(D), 'MM/DD/YY') as [Week Ending]

NOTE:  "D"=my date field (which is not in MM/DD/YY format)

1 Solution

Accepted Solutions
sunny_talwar

May be like this:

Date(WeekEnd(D, 0, 5), 'MM/DD/YY') as [Week Ending]

View solution in original post

2 Replies
sunny_talwar

May be like this:

Date(WeekEnd(D, 0, 5), 'MM/DD/YY') as [Week Ending]

Not applicable
Author

Yes, that worked!  Thank you!