Sums, Counts, Averages, Min and Max
This is how you can display sums, counts, averages, min and max with your Adalo app.
Last updated
This is how you can display sums, counts, averages, min and max with your Adalo app.
Last updated
Skill Level: Intermediate to Expert
Should have knowledge of Databases
When you have two collections in your database that are related to each other, you can use Magic Text to display Sums, Counts, Averages, Min and Max.
For example, if you have a database collection of Trips and another collection of Activities (and each Activity has a price property) where each Trip can have multiple Activities, if you have a screen or list displaying information about a Trip, you can use Magic Text to display:
The Count of Activities for that Trip
The Sum of the Prices for that Trip's Activities
The Average Price for that Trip's Activities
The Maximum Price for that Trip's Activities
The Minimum Price for that Trip's Activities
As with any number, you can click on the chip to customize the number formatting when it is displayed in your app.
You can also add filters to specify which records are included in these aggregations. For example, if your Activities collection has a True/False property for "Will Definitely Do," then you can add a filter so that you're only showing the Sum of the Prices for Activities where "Will Definitely Do" is equal to True.
To add a filter, simply click on the chip, and select Add Filter.
If you need additional help with this article, you can always ask in our community forum! Be sure to paste the link to this article in your post as well!