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

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
#SANTALYTICS

Gather all 9 clues to complete the final Weekly Challenge on Dec 16!

Learn More
SOLVED

Convert ISO 8601 duration to youtube format MM:SS

Meteor

So I have ISO 8601 formats for youtube video. For example I have PT10M1S, need to convert this to MM:SS. I found a few possible solutions for this. But nothing seems to be working. Thank You ahead of time

Alteryx Partner

I can't find any info on the M and S, although I assume this is minutes and seconds.  Is the PT related to Pacific Time and if so is there a date ?

 

Can you provide some dummy data that has M as a single digit and a double digit - just to be sure the solution is correct ?

Alteryx Partner

LOTS of expressions in here so you can see what I've done.  It's possible to consolidate it if you need to.

I suggest:

 

2019-01-12_11-29-29.jpg

 

First use Regex to parse the expression:

^P(\d+Y)?(\d+M)?(\d+D)?(T(\d+H)?(\d+M)?(\d+S)?)?$

You can then use a multifield formula to convert to integer columns of Year, Month, Day, Hour. Minute. Second

 

Finally to put back to YouTube you can just another formula tool.

Meteor

Works perfectly! Thank You

Labels