How to calculate values in an Entity

How to calculate values in an Entity

  
I am testing the software and read a few articles, but still cannot find the correct answer for what i am trying to do. I have a projects table and a value column. I want to know if there is a way to calculate the value of all the projects?
Hi Neels,

Can you give us some more information? I'm guessing you mean that you have a table that has a column containing a value, and you wish to display on the page a sum of all the values in that column?

One way to do this would be using an Advanced Query and using SUM in your SQL.

Thanks,
Richard
Hi Richard

Thank you for the reply, the column is called project value and you are correct, i want to add up all the values in the column to display a total of what the current projects are worth.

Regards
Neels
Hi Neels,

Personally I'd use an Advanced Query and use SUM to determine the total.

An alternative would be to use a For Each loop in your preperation to loop through each project totalling the value.

I can't think of an easy way of doing it apart from that. Maybe someone else might be able to suggest an alternative?

Thanks,
Richard
Hi Richard

Thank you, i will try it over the weekend and let you know.

Regards
Neels
Neels Koen wrote:
Hi Richard

Thank you, i will try it over the weekend and let you know.

Regards
Neels
 Hi, could you find a solution for this and could you please share it with me. Have simmiliar need,

Thanks,
 
Martin -

Richard's two answers are the best approaches to this issue.

J.Ja
In your advanced query, it should add a grand total if you use "GROUP BY .... WITH ROLLUP". 
Neels, if you are starting  to use the OutSystems Platform, you should check out the training videos.
I'm sure they'll help you learning the development environment and the fundamentals.