How to set a dynamic/relative default value (current fiscal period) on a Platform Analytics dashboar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
18m ago
Hi everyone,
I have a Platform Analytics dashboard with a single-select filter ("Periodo") whose data source is the fiscal_period table, applied to a database view (u_ocp_devengado_comercial_vw) through the reference field dev_u_fiscal_period.
GOAL
The dashboard should open on the current monthly fiscal period (e.g. FY26: M11) and still let users switch to any other period. The period should roll over automatically each month.
WHAT I FOUND
- The "Default value" field of the filter only accepts a concrete fiscal_period record (typing a name works, nothing dynamic is offered).
- fiscal_period.start_date_time / end_date_time are of type schedule_date_time, so I can't use relative date operators on them. A date-range filter is not an option because the view has no date field of its own, only the fiscal period reference.
- I created a Dynamic Filter Option ("Periodo fiscal actual", backed by a Script Include with Sandbox enabled). It works as an "is (dynamic)" condition in the data source and in list filters. But if I put it in the data source of the report, it is ANDed with the dashboard filter, so selecting another period returns no data.
WHAT I TRIED (without success)
I wrote the current period into the stored default value by script (in a background script), updating:
- par_component_filter.properties
- par_dashboard_widget.component_props
- par_dashboard_canvas.layout
(defaultSelectedItems -> id/label). The records update correctly, I flushed the cache, but the dashboard keeps opening on the value that was last saved from the UI. I also tried with a brand new filter and with the old one deleted. Same result.
QUESTIONS
1. Is there a supported way to configure a dynamic or relative default value (e.g. "current period") for a dashboard filter over a reference field?
2. If not, where does the dashboard actually read the saved default from when it opens (a published version, a per-user state, another table)?
3. Is there any recommended workaround to keep a default that follows the current month?
Platform: Australia
Thanks in advance!