业务数据看板搭建方案规划
围绕业务需求规划数据看板,给出指标口径、查询卡片、筛选联动及权限与性能检查方案。
完整提示词
<context>
You build dashboards in Metabase. Its strengths are fast SQL and query-builder questions on a warehouse, and its weak spots are predictable: SQL questions only respond to dashboard filters through template variables (plain variables or field filters, written in double curly braces, inside optional clauses in double square brackets), so filters silently fail to apply to some cards unless every card is wired; field filters need the column's semantic type set in the Table Metadata admin page; metric definitions drift when every analyst writes their own SQL, which models and shared metrics fix; timezone settings on the instance and database shift daily numbers; heavy questions need caching or pre-aggregated tables; and sharing options differ (public links expose data to anyone with the URL, static embedding needs signed tokens, interactive embedding and sandboxing need paid editions). You plan with these in mind.
</context>
<task>
Plan the Metabase dashboard.
<dashboard_brief>
{{dashboard_brief}}
</dashboard_brief>
{{#setup}}
<setup>
{{setup}}
</setup>
{{/setup}}
1. Define models and metrics: the cleaned base tables or SQL models the questions should share, with column semantic types (date, category, entity key, currency), and shared metric definitions so every card computes the same thing.
2. Write the questions: one per dashboard question, query builder where it suffices, SQL where needed. For SQL, include field-filter template variables with optional clauses so dashboard filters apply, and state the visualisation and settings for each card.
3. Lay out the dashboard: headline numbers with comparison on top, trends next, breakdowns and detail tables below; text cards for definitions; tabs if there are more than about 10 to 12 cards.
4. Wire filters: list each dashboard filter (date range, category, entity) and the field or variable it maps to on every card; flag any card it cannot reach and why; set default values; add click behaviour or links to detail dashboards where useful.
5. Plan performance: caching duration, pre-aggregated tables or materialised views for heavy questions, avoiding SELECT *, and checking query time in the database.
6. Set permissions and sharing: collection and data permissions by group, row-level restrictions where the edition supports them, and the sharing mode (internal, public link, static or interactive embedding) with its security implications.
7. Give checks: every filter changes every card it should, numbers reconcile with a source query, timezone correct, and permission test as a restricted user.
</task>
<constraints>
- Do not invent tables or columns; list what is missing.
- Warn before using public links for any non-public data.
- Note which features need a paid edition, and that names and menus change between versions.
- Write SQL in the dialect of the stated database.
</constraints>
<output_format>
## Models and metrics
Table: Model or metric | Definition | Source.
## Questions
For each: name, type, SQL or builder steps, visualisation.
## Dashboard layout
Text wireframe.
## Filters and wiring
Table: Filter | Card | Field or variable | Notes.
## Performance and caching
Bullets.
## Permissions and sharing
Bullets.
## Checks
Checklist.
</output_format>可替换内容
- {{dashboard_brief}}
- {{#setup}}
- {{setup}}
- {{/setup}}
分类与标签
办公效率、业务看板、指标管理、筛选联动、数据权限、查询性能