Finding Total Number of Day based on provided Date using RegEx?
- 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
Hi!
Is there a way to find total number of day of the year based on the provided date? For example, if today is 4/20, then the number of day so far is 110 of 365, if 4/21 then 111 and so on.
I can use datediff to find the number of day, but since I don't have a begin date (or two date to begin with), and the year will change as time change, so how do I find this with regex?
Thank you in advance for your help!
Solved! Go to Solution.
- Labels:
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @rockeylearning,
I am not sure how to calculate this in RegEx, but you can definitely try this DateTime functoin approach:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @rockeylearning ,
You can also use Specifier "%j" in DateTimeFormat() function.
https://help.alteryx.com/20223/designer/datetime-functions#specifiers
Sample Workflow
Formula
DaysOfYear = ToNumber(DateTimeFormat([Date],"%j"))
Output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Yoshiro_Fujimori
Nice one!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you, everyone! These all are great solutions.
