Number to Duration

Hello!
I have to transform a number to a duration.
How can I handle this problem?

The value of the number was already a duration, but for the “Group by” and “sum” -function i had transformed it in a number

Best Regards

Hi @SilberbauerM

The only thing I can think of right now is the following:

  1. Use math nodes to get values (in separate columns) for hours, minutes, seconds, etc. from your existing number value. Make sure to convert these to integers
  2. Convert these integers to strings
  3. Use a string manipulation node to join these strings into one long string, along with the relevant indicators for the time periods involved.
  4. Use the String to Duration node to get your duration.
2 Likes

Hi @SilberbauerM,

welcome to KNIME Community!

I’m missing something here cause in GroupBy node you can’t use Sum function on Duration type column. So if it was Integer column simply add appropriate letter to it (y,M,d,H,m,s) using join() function in String Manipulation node followed by already mentioned String to Duration node.

Br,
Ivan