Rollup is an empowering field type if you using currencies or numbers in your application. A rollup field is aggregates specific cells from records of a list to another field in your application.
For example you have two lists:
- A list of orders which contains all information linked to a customer order online, including a multiple linked-list field type of items.
- A list of items which contains a catalog of all available products sold by the company including its selling price.
A lookup field in the orders table will allow to calculate the sum of items linked to a specific order.
Let's get a little deeper into it:
The rollup field have three options you have to select them:
- Linked List to Rollup: Chose the list you want to rollup data from. The list should already be linked in order to roll it up. The system will automatically display the lists linked to the current list. If you are not able to make a choice, this means that no list is linked. Read more about Linked list
- Rollup Field: Chose the field that you want to aggregate the data from. This field type have to be either currency or number. The system will automatically display the numerical fields from the selected linked list. If it is empty, this means that no numerical fields exist in the linked list.
- Summery Type: Workiom provides five aggregate functions as follow:
- Sum: Adds up all values.
- Average: Returns the average of values.
- Min: Returns the smallest value
- Max: Returns the largest value.
- Count: Count all linked records including records with zero values.
In our template Educational institute, we have many lists, one of them named Students, and the other Payments.
Payments list keeps a record of students' payments and it contains a currency field type named "Amount" to indicate the value of the made payment.
We also have a Students list and it contains all students information in an institute.
To display the total amounts of payments made by a student, we to aggregate the payments values for each user in the Students list. But how?
We will create a new linked list field in Students , and link it to Payments as follow:
We will create a new rollup field in Students and name it Total Payments as follow:
- Field type: Rollup.
- Linked list to Rollup: Payments list.
- Rollup Field: Amount.
- Summery Type: Sum.
Now, the system automatically will calculate the total payments for each student. When adding a new payment, the total payments will be increase, and so on so forth!
Let's take a look to Payments an Students lists:
Note: our template Educational institute is customized and ready to use. no need to make the updates above that it is just for educational purposes.