DateTimeFormat how to adjust?
- 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
Dear all, Hello!
I am having some issues with this formula:
What I need is that "2021-06-09" should be WEEK ONE as "1", instead of 23, however it is reading based on the calendar. Is there any other workaround for that?
I still need Alteryx to read the subsequent weeks by the calendar, its just that it should start as week one instead of 23.
Tks!
Solved! Go to Solution.
- Labels:
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
What if you use the summarize tool to find the minimum date, then append this value to the data before the summarize. Then you can use a formula tool with a datetimediff to calculate the number of months from the current date to the minimum. This would effectively give you a month number starting from a minimum value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
the "%w" parameter is a fixed value of week from beginning of the year. You are looking for floor(datetimediff([RN_Execution_Date],"2021-06-09","days"),7)+1
For a relative week comparison use datetimediff, floor divide by 7, and add 1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@apathetichell awesome example! I always forget about the floor function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@BrandonB FLOOR function is the batch macro of math functions,. Endless uses.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Guys I will be checking both solutions in a bit.. give me afew minutes!! Thank you for both replies in advance!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Apathetic,
I am trying to use your formula, but there is a parse error. I tried to fix but I dont see any mistakes... any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Sorry my syntax was slightly off:
floor(datetimediff([RN_Execution_Date],"2021-06-09","days")/7)+1
always get the syntax between mod and floor confused.
So change where I had ",7" to "/7".
