Date Convert to Week Ended
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'm new to Alteryx, hopefully this is an easy question... I'm trying to identify the week ending date based on a date that I have. For example, today's date 07/09/2019 would be the Friday week ended 07/12/2019. Thanks!!
Solved! Go to Solution.
- Labels:
- Date Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
A pretty brute force method would be to figure out the day of the week (Monday = 2, for example) and then calculate the difference between the given date and Friday (4 days, using our example). Then add that number of days to the original date using a datetimeadd formula.
This would need to adjust for Saturdays however, as I'm guessing you'd want the following week, not the previous day.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @CPAul
I went for an approach that adds 7 days onto your date and then filters for the fridays...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Clever! thank you!
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
one very minor correction to the solution, the "Condition Expression" in the Generate Rows tool should be:
DateAdd <= DateTimeAdd(Date, 6, "Days")
instead of:
DateAdd <= DateTimeAdd(Date, 7, "Days")
The original way double counted days that were already a Friday.
Thanks again,
Paul
