community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Community v19.9

The latest release includes several enhancements designed to improve your Community experience!

Learn More
SOLVED

Extracting abbreviated date from a string

Meteor

Hello Alteryx community,

 

I am looking for help in extracting an abbreviated date from a string. Then, I'll use that date to count the number of days between it and another datetime column. Here is an example dataset:

 

IDDateTimeEvent Tag
12019-03-18Bakersfield (Apr 22)
22019-03-18Thomaston (Jun 26)
32019-03-18Callifer (Sep 2)

 

As you can see, the dates in DateTime can be the same but have event tags for days near and far. For reference, the values in Event Tag are always structured the same way: "LOCATION (MMM DD)." What I need to do is clean the cell so all that's left is "Apr 22" or "Jun 26" or "Sep 2," which I can then parse into a date. Here's what I need to see in the next step:

 

IDDateTimeEvent TagEvent Tag Date
12019-03-18Bakersfield (Apr 22)2019-04-22
22019-03-18Thomaston (Jun 26)2019-06-26
32019-03-18Callifer (Sep 2)2019-09-02

 

Finally, I want to count the number of days between DateTime and Event Tag Date, so the final dataset appears as follows:

 

IDDateTimeEvent TagEvent Tag DateDaysInBetween
12019-03-18Bakersfield (Apr 22)2019-04-2232
22019-03-18Thomaston (Jun 26)2019-06-2668
32019-03-18Callifer (Sep 2)2019-09-02140

 

The final dataset will help me assess the time between the date of a purchase and the event to which the purchase applies.

Alteryx Certified Partner

Hi @essemMLB ,

 

Attached is an example showing how you can accomplish that.

 

Let me know if that works for you, please.

Best,

Fernando V.

Meteor

Thank you so much!

Labels