OpenSpecimen allows you to specify aggregate functions like count, sum, average, etc. on specific fields and also apply filters on aggregate filters.
Non-Super Admins cannot run aggregate queries containing PHI fields. |
Based on the field selected, aggregate functions available differ. For numeric fields functions like sum, avg etc. are available but for text fields only count is available. |
For pivot table types of summary reports, refer to examples documented in 'Summary reports (Pivot table)'.
Conditions can also be applied on aggregate functions. This can be done by going to 'Actions' → 'Columns' and going to last step 'Reporting Options'.
Expression: count(Specimen.id)>10
Expression: sum(Specimen.availableQty)<10
Expression: count(SpecimenCollectionGroup.name)>1