Overview
Rollups are essentially aggregated data. This is analogous to the "GROUP BY" clause in SQL. When editing fields of the dGraph, you need to mark the field as a rollup. This provides the field with the ability to be used as a rollup field. This means it is valid to use it in the Rollup clause when querying.
After you define a field as rollup, you may then add derived fields for the operation. Derived fields are analogous to the aggregate functions in SQL: sum, average, min, max, and count. These allow you to aggregate fields and create a new type of rollup record. Fields can also be eliminated from rollups by the architect, limiting what software developers can use. This may be required by business rules.
Derived Fields
In addition to grouping records by some commonality, there is also the ability to aggregate fields. In other words, data can be truly rolled up based on the underlying set. Derived fields do not exist in your database but are calculated on the fly. They are essentially calculated fields. In a dGraph, you can define fields that should be aggregated based on a data dimension using sum, min, max, count, or average. In the automobile dGraph example, you could define derived fields minimum miles per gallon and maximum miles per gallon. When you rollup records by the dimension "year", there would be extra fields added that map to these calculations. To software developers it is just another data field. This gives you the flexibility to provide users with all sorts of aggregated data based on very specific data layouts.





