Adding 2 Times
- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Silenciar
- Página de impresión sencilla
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Notificar al moderador
Hi all,
I have this data and I want to add the (duration in Mins) to the time on the first column.
I tried many ways but couldn't do it. One of them is using the following function but it's not working:
Any advice on what's the best way, hopefully easy one?
¡Resuelto! Ir a solución.
- Etiquetas:
- Preparation
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Notificar al moderador
Hello @Maltaleb001 ,
Thats an interesting question. Would like to know if there is a better way than this one:
DateTimeAdd([Field1],DateTimeSeconds([Field2])+60*DateTimeMinutes([Field2])+DateTimeHour([Field2])*3600, 'seconds')
Here I am transforming the time into seconds
Hope it helps
Regards
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Notificar al moderador
You need to convert the time to a number field with the total number of minutes or seconds to add on in order to use DateTimeAdd. See a couple of solutions on this thread:
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Adding-Times-Together/td-p/8658
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Notificar al moderador
Hi @Maltaleb001,
I decided to use three separate formulas to add on the hours, minutes and seconds
DateTimeAdd([DateTime],DateTimeHour(ToDateTime('1900-01-01 ' + ToString([Duration in Mins]))),'hour')
DateTimeAdd([DateTime],DateTimeMinutes(ToDateTime('1900-01-01 ' + ToString([Duration in Mins]))),'minute')
DateTimeAdd([DateTime],DateTimeSeconds(ToDateTime('1900-01-01 ' + ToString([Duration in Mins]))),'seconds')
I've attached my workflow for you to download if needed!
Kind regards,
Jonathan