-
Notifications
You must be signed in to change notification settings - Fork 29
Filters for report data, similar to time range #3781
Description
As a user I want to select a category/location from a dropdown filter, similar to the list filters, in order to narrow down the range of a report in addition to a time range.
Objective
Sometimes users need a report on a subset of data, e.g. just for one of their programs / locations / risk categories. It would be useful to have flexible filters for the data going into one report, similar to how users can filter the lists already. Filtering of data is already supported with a time range. Extend this to support any kind of field.
Proposed Solutions & Alternatives
The time range placeholders are already configurable in the transformations property of the ReportConfig entity:
ndb-core/src/app/features/reporting/report-config.ts
Lines 44 to 50 in 9829a0e
| /** | |
| * (sql v2 only) transformations that are applied to input variables (e.g. startDate, endDate) | |
| * example: {startDate: ["SQL_FROM_DATE"], endDate: ["SQL_TO_DATE"]} | |
| */ | |
| @DatabaseField() transformations: { | |
| [key: string]: string[]; | |
| }; |
This is slightly confusing (maybe we can simplify the config structures?). But it works well in making the $startDate placeholders available to use within the SQL string. Similarly, we should allow additional params here.
The filter params need to link to a schema field, so that we can show a user-friendly filter dropdown, e.g. with the given enum-options for that field.
This will need changes to Frontend and Backend.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status