SOLVED
Getting the start date of a week based on the date in row
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Deano478
12 - Quasar
‎02-26-2024
01:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi folks,
This might be something that may not be possible in Alteryx as I've tried various approaches and had no luck but here i goes:
I have data like so in which the category or code will never change:
Name | Category | Code | Date Inputted |
Dean Test | Leave | OT | 08/02/2023 |
Dean Test | Leave | OT | 22/09/2022 |
Dean Test | Leave | OT | 24/02/2023 |
Mark Test | Leave | OT | 13/10/2022 |
Mark Test | Leave | OT | 21/09/2022 |
Mark Test | Leave | OT | 21/05/2023 |
And what im trying to achieve is a dynamic way to get get the first of the week for the date Inputted
Solved! Go to Solution.
3 REPLIES 3
binuacs
21 - Polaris
‎02-26-2024
02:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Deano478 what is the expected output?
JamesC
6 - Meteoroid
‎02-26-2024
02:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Assuming you'd like the Monday to be the start of the week, this formula should work:
DateTimeAdd([Date],-ToNumber(DateTimeFormat([Date], '%u'))+1,"day")
This converts the current Date field to 1-7 (Mon-Sun), then uses that to get back to Monday
JPSeagull
8 - Asteroid
‎02-06-2025
03:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This is perfect. I needed it to start on Sunday and just removed the +1. Thank you!
