how to sum attributes from the same database?
Application Type
Traditional Web


So, I am doing an app to keep on track my tasks and my "to do list" and I want to create something to tell me how much time i spent. I have everything ready, the tasks already have the time I spent. Now, I only need to sum that. How do I sum those attributtes? They are on the same entity... Do I need to create a new entity, the attribute "sum" is in the same entity?

I don´t know,  please help me

If you want me to, i can drop my OML here

Rank: #70

What do you want to do with that piece of information? To show it on a screen?

If that's the case, you can place an expression on the screen with the SUM field of your query. 

If your screen presents a list of tasks and its time and now you want to show the total, you should separate the queries: one "Get Tasks", the other one "Get Total Time" which sums the time.

Rank: #446

Hi Goncalo,

It would be nice, if you can share the OML here for speedy response.

Thanks & Kind Regards,


Rank: #70

Hi Gonçalo,

You can do an aggregate and sum the attribute Time.

On your aggregate, double click the attribute having the time and select the option Sum, like in the example below:

For more information, consider this article from OutSystems documentation: