0

# How to get Sum of time Difference

I have a calculation like

string(

round(

BZ_Bot_Utilization.Bot_Utilization.TimestampInSec / 3600

)

) + ":" + string(

round(

floor(

(BZ_Bot_Utilization.Bot_Utilization.TimestampInSec%3600) / 60

)

)

) + ":" + string(

round(

floor(

(BZ_Bot_Utilization.Bot_Utilization.TimestampInSec%3600)%60

)

)

)

But this calculation give string how to convert into measure .please let me know.

8replies Oldest first
• Oldest first
• Popular
• Have you looked at the formatDuration() function? You can do the calculation from your timestamps, convert to an integer using the int() function and then format the result with the formatDuration() funciton.

Like
• formatDuration(

int(

double(

timestamp(

string(

round(

BZ_Bot_Utilization.Bot_Utilization.TimestampInSec / 3600

)

)

)

)

)+ ":" + formatDuration(

int(

double(

timestamp(

string(

round(

floor(

(BZ_Bot_Utilization.Bot_Utilization.TimestampInSec%3600) / 60

)

)

)

)

)

)+ ":" + formatDuration(

int(

double(

timestamp(

string(

round(

floor(

(BZ_Bot_Utilization.Bot_Utilization.TimestampInSec%3600)%60

)

)

)

)

)

)

)

Like
• i am using this but i am getting error like

Formula cannot be saved. No matching signature found for function: "double" with params: [TIMESTAMP], Hint for schema formula columns: check that there is no nested schema formulas.

this  error i am getting.

Like
• Mahesh Kocherla  You cannot convert a timestamp to a double , to debug can you create separate formula fields for the inner expressions to see where the error is coming from?

Like

Like
• Mahesh Kocherla if data is stored as MM:SS then why don't you create 2 formula col in the table to split MM:SS using substring formula

- first formula column will store minutes as int data type

- second formula column will store minutes as int data type

You can add and combine 2 formula col into MM:SS using formatDuration.

Like
• can you please give me sample formula. how to do

Like
• Mahesh Kocherla  created this video using your use case:

Like 1
Like Follow
• 6 mths agoLast active
• 8Replies
• 53Views
• 4 Following