Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adding a column of time totals

Avatar

Level 2

Hello,

I have a column of  time totals in a table that I'd like to add.

For example:

11:33

25:56

67:44

and so on. The method is to split/parse the string, add the rightmost 2 digits of each total to get the total minutes, and the leftmost 2 digits to get the total hours. I haven't included anything to process the minutes total further (i.e. mins / 60 etc) as I can't even get the basic calculation working first.

The code I'm trying is:

//check if at least one row exists in this section of the table

if  (_Row1.count > 0) then                                                         

     //add rightmost two digits to get minutes total

     mins = Sum (Right (Row1[*].total[*], 2))                                

      //add leftmost two digits to get hours total

     hrs = Sum (Left (Row1[*].total[*], (Len (Row1[*].total[*] - 3))))  

endif

I'd appreciate someone telling me why this is not working. The table is dynamic and rows are added as needed. 
Thanks.

Message was edited by: HarryOhm

0 Replies

Avatar

Level 2

Please disregard. I got it working finally.

Avatar

Level 2

What was the final code that worked?

thanks,