Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Converting durations to hh:mm:ss from string

Seba
5 - Atom

Hi Alteryx Community!

 

Creating a workflow with a data from different YouTube channels, I met a problem with converting videos durations; In the data extract from YouTube (sample attached), I have a column "Film length (minutes)" which contains data about film lenght where for example 7 minutes and 30 seconds is given as: 7.50.

Therefore, I have two questions:

 

1. How to convert this data, to be displayed as hh:mm:ss

 

2. Is it possible to sum the durations of all videos from one channel or channels category keeping the hh:mm:ss format?

 

I was able to do first conversion preparing dashboard in Tableau but it was working only on the deepest level of one video. When I was rollig up the data to channel or a category level the subtotals was counted rounding to 100 instead of 60 (so sum of the durations of two movies with the same duration of 7:45 was displayed as 14:90 instead of 15:30).

 

I was looking for solution at the Community, I found some similar topics about converting time but none of them was reated to durations where after conversion it's also needed to be able to do some operations like summing or subtraction.

 

I will be grateful for any suggestions how to solve this cases.

 

Thanks,
Sebastian

3 REPLIES 3
MarqueeCrew
20 - Arcturus
20 - Arcturus
Can I start you out with a hint?

7:45 is seven minutes and forty five seconds. 45 divided by 60 equals .75.

If you added 7.75 and 7.75 you would get 15.50. .5 times 60 equals 30.

15:30 is what you're after.

Does this help?
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
cmcclellan
13 - Pulsar

Try this, I put in a lot of little steps so you can see the process.  The top stream is for each individual record, the bottom stream is for the aggregate.

 

There's probably better ways, but if someone corrects me then I learn as well :)

Seba
5 - Atom

Thank you for the advices, it was very helpful for me. Now I know how to solve the problem :)

 

Cheers!

 

 

Labels