Hello,
In my project, we have two types of working hours in a day: number and HH:MM.
I want to sum it up by comparing it to working hours in a week.
I can do it easily for numbers in the SME. Then I got struggled to sum the string as an example: 03:45 + 04:15 + 06:30.
So my question is how can I convert this to: 3.75 + 4.25 + 6.5 for calculation?
Thanks
Hi @mai-green-rush ,
You can extract numbers from your string using the RangeAsNumber(field,start,end) operator.
hours = RangeAsNumber(time_field,1,2)
minutes = RangeAsNumber(time_field,4,5)
Once you have your hours and minutes stored as numbers, you can add them up.
total_hours = Sum(…/times*/hours)
total_minutes = Sum(…/times*/minutes)
You can either do the conversion to hours with decimal places at the beginning or the end of the summing process. I did it at the end in the intermediate fields using the following operators:
Adjusted_minutes = [total_minutes]-{60*RoundDown([total_minutes]/60)}
Adjusted_hours = [total_hours]+RoundDown([total_minutes]/60)
Hi @malcolm-silver-ice ,
Thank you so much for helping me to convert the time from string to number. I made it on my model successfully.

