Scheduled reports with filters #42544
|
Is it possible to create scheduled reports and specify filters for existing charts? We are looking to generate the same report for multiple clients, applying filters to restrict the data in the report, customizing for each client. Since the reporting UI doesn't allow for customized filters for each report, so far, the only way we've been able to figure out how to do this would be to generate a unique chart for each client. This might work when we have a small handful of clients, but will certainly not scale. Or possibly, we could create Alerts for each client, which do allow for customized filters, and the alert 'triggers' when 1 > 0 (meaning all the time). We came across an earlier discussion in which dosubot recommends using the API to define a We've looked into doing something custom within the celery config, but we were a little out of our depth and figured we should check here before we go down a rabbit hole. So, is there something we've overlooked or is this simply something Superset can't do natively at the moment? Thanks for your time. |
Replies: 1 comment 10 replies
|
Actually, I'm going to correct myself. The Alerts approach doesn't work either. We could put custom filters in the 'condition', but not in the results that get exported. |
Thanks @dosu that lead us in the right direction. To follow up and provide a fuller answer, for anyone else coming across this issue, we were able to generate a filter'd report using the API for the create (
POST /api/v1/report). In order to do so, we had to do the following:First, we had to get the list of native filters for the dashboard:
GET /api/v1/dashboard/:id, which provided us with this in the response:{ "result": { ... "json_metadata": "<stringified json>" } }If we unpack the
json_metadata, we find (apologize for the verbosity here, but I've stripped away most of what wasn't important):{ "native_filter_configuration": [ { "id": "NATIVE_FILTER-abcdefg", …