Create a total row on a table records.


Hi there,

I have a table records widget that shows Time Report Items, with the columns DescriptionStart Date, End Date and Number of Days. I want that the last line of the table records shows a total of the Number of Days but I'm currently struggling with it. 
 
Any tips about the best way to do this?

thanks,

Use a variable to add them up and then add a dummy record with the total.
Gerry wrote:
Use a variable to add them up and then add a dummy record with the total.
 I got through the aggregate with a for each and stored the total in a variable, but i don't know where to go from here, how should i create the dummy record you mention? i haven't seen anything similar in the tutorial videos,

thanks for the help
 

Say for example you have a record list variable containing these records. Use the List Append action to add a record at the end and choose one of the columns to hold your total. Then refresh the list.

I managed to solve it with your suggestion, thanks.

Tiago Silva wrote:


I managed to solve it with your suggestion, thanks.


Hi Tiago,


I am trying to do the same but i am struggling on the " aggregate and  for each" parts. Could you please advise or share part of your code? Many Thanks.

Hi Tiago,

As I understood you need to do a sum operation of the total days. So for that, you can take a separate aggregate and do the sum of the day's columns. Also, you have to create a table for it with a row. and on that row, you can take an expression and put the Result of the sum column.

If it is not the scenario then please share the OML file so I can able to do the update on it.

Thank you,

Sudip