Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Finding Total Number of Day based on provided Date using RegEx?

rockeylearning
8 - Asteroid

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!

5 REPLIES 5
nagakavyasri
12 - Quasar

one way of doing:Screenshot 2023-04-20 175313.png

martinding
13 - Pulsar

Hi @rockeylearning,

 

I am not sure how to calculate this in RegEx, but you can definitely try this DateTime functoin approach:

martinding_0-1682027994478.png

 

Yoshiro_Fujimori
15 - Aurora

Hi @rockeylearning ,

 

You can also use Specifier "%j" in DateTimeFormat() function.

https://help.alteryx.com/20223/designer/datetime-functions#specifiers

Yoshiro_Fujimori_0-1682031821035.png

 

Sample Workflow

Yoshiro_Fujimori_0-1682032142588.png

 

Formula

DaysOfYear = ToNumber(DateTimeFormat([Date],"%j"))

 

Output

Yoshiro_Fujimori_1-1682032164854.png

 

Qiu
21 - Polaris
21 - Polaris

@Yoshiro_Fujimori 
Nice one!

rockeylearning
8 - Asteroid

Thank you, everyone! These all are great solutions. 

Labels
Top Solution Authors