DataJunction / dj

A metrics platform.
http://datajunction.io
MIT License
29 stars 13 forks source link

User-configured filtersets for cubes #1061

Open shangyian opened 1 week ago

shangyian commented 1 week ago

When someone creates a cube, they should also be able to save one or more filtersets on the cube. A filterset is a set of filters on dimensions in the cube.

For example, let's say the cube is:

- metrics:
  - default.num_repair_orders
  - default.avg_repair_time
- dimensions:
  - default.hard_hat.city
  - default.contractor.company_name

Possible filtersets on this cube include:

name: Tuscon Repairs with Pothole Pete
filters:
  - default.hard_hat.city = 'Tuscon'
  - default.contractor.company_name = 'Pothole Pete'

name: Repairs with Pothole Pete
filters:
  - default.contractor.company_name = 'Pothole Pete'

To support this, we would add a filterset table:

name: str
filters: List[str]
node_revision_id: int
created_by: str
created_at: timestamp
deactivated_at: timestamp