Putting data into groups to calculate aggregated values allows you to extract more information from your data sets. In OutSystems, you can use aggregate functions to calculate values based on groups of identical data.
Fetch the data in an aggregate and do the following:
- In the attribute with identical data, use the menu and select Group by <attribute>.
- In the attribute to calculate, use the menu and select an aggregate function such as Count.
Once you group or use aggregate functions on attributes, those attributes become the only output of the aggregate.
In the GoOutWeb application to find, review, and rate places, you want to show the average rating of places to help to take a decision. Consider that you already have an Aggregate fetching all the reviews of a place from the database. Open the aggregate and do the following:
Place.Idattribute, open the menu and choose Group By Id.
Review.Rateattribute, open the menu and choose Average.
Use the calculated values to display the average rating for each place on the screen.