luvv to helpDiscover the Best Free Online Tools
Topic 8 of 8

Managing Shared Definitions Safely

Learn Managing Shared Definitions Safely for free with explanations, exercises, and a quick test (for BI Analyst).

Published: December 22, 2025 | Updated: December 22, 2025

Why this matters

As a BI Analyst, you define metrics, dimensions, and logic that many dashboards, reports, and stakeholders depend on. A small change to a shared definition (like Revenue or Active Users) can silently break KPIs, confuse leadership, or misalign teams. Managing shared definitions safely protects trust, reduces fire drills, and keeps data work predictable.

  • Real tasks: update a metric definition (e.g., exclude refunds), rename a column used by many reports, deprecate a legacy KPI, or align logic across teams.
  • Risks: broken dashboards, mismatched numbers in meetings, and time lost debugging.

Concept explained simply

Shared definitions are the single sources of truth for business logic: metric formulas, calculation filters, dimension derivations, standard SQL snippets, and semantic layer or BI model files. They are assets used by many downstream users and reports.

What counts as a shared definition?
  • Metric and dimension specs in semantic layers or BI models (YAML, JSON, LookML-like files, etc.).
  • SQL views or models referenced by multiple dashboards.
  • Reusable CTEs, macros, or templates consumed by many queries.

Mental model: "Contracts and migrations"

Treat shared definitions like public APIs. Consumers rely on contracts (names, types, meanings). Changes should be versioned, reviewed, and migrated with backward compatibility whenever possible.

  • Contract: the stable interface (names, semantics, data types, allowed values).
  • Change: propose, review, test, release, communicate, migrate, clean up.
  • Guardrails: PR reviews, tests, deprecation windows, and clear ownership.

Key principles and guardrails

  • Prefer additive changes: add new fields/metrics instead of mutating existing ones.
  • Use aliases or temporary shims to maintain backward compatibility during migration.
  • Document the change plan: who is impacted, risk level, rollout steps, and fallback.
  • Require peer review from data owners of impacted domains.
  • Automate checks: unit tests for logic, schema tests for types/nulls, and linting for naming.
  • Communicate timelines and deprecation dates. Avoid surprise Friday releases.
  • Have an immediate revert plan for emergencies.

Worked examples

Example 1 — Change a metric filter safely

Goal: Update revenue to exclude refunds. Dashboards currently use revenue widely.

  1. Add a new metric revenue_net with the new logic.
  2. Mark revenue as deprecated and keep it unchanged for a migration window.
  3. Communicate the change, owners, impact, and migration date.
  4. After migration, update revenue to point to revenue_net or remove it if safe.
# Before (semantic.yml)
metrics:
  - name: revenue
    sql: SUM(order_amount)
    label: Revenue
# After (additive with deprecation)
metrics:
  - name: revenue
    sql: SUM(order_amount)
    label: Revenue (Deprecated; use revenue_net)
    tags: [deprecated]
  - name: revenue_net
    sql: SUM(CASE WHEN refund_flag = 0 THEN order_amount ELSE 0 END)
    label: Revenue (Net)
Example 2 — Rename a widely used dimension

Goal: Rename signup_date to user_signup_date for clarity.

  1. Add user_signup_date while keeping signup_date as an alias that references the new field.
  2. Tag the old name as deprecated; communicate and provide a removal date.
  3. Update core dashboards; leave the alias until others migrate.
# Before
dimensions:
  - name: signup_date
    type: date
    sql: user.signup_ts::date
# After
dimensions:
  - name: user_signup_date
    type: date
    sql: user.signup_ts::date
  - name: signup_date
    type: date
    sql: ${user_signup_date}
    tags: [deprecated]
Example 3 — Tighten a calculation without breaking consumers

Goal: Adjust active_users_7d logic from login-based to event-based activity.

  1. Introduce active_users_7d_v2 with event logic and add tests.
  2. Run both metrics in parallel; compare for a period to validate stability.
  3. Communicate differences and update decision-critical dashboards first.
  4. Deprecate and later remove v1 after adoption.

Workflow: Safe change lifecycle

  1. Discover & scope: Define the problem, list consumers, estimate risk.
  2. Design: Prefer additive changes; plan aliases, deprecation window, and tests.
  3. Implement in a branch: Update definitions, add tests, and run CI locally if possible.
  4. Pull Request: Include change plan, impact list, screenshots of test results, and rollback steps.
  5. Review: Get approvals from data owners and an analyst who owns key dashboards.
  6. Release: Merge during a safe window; monitor key metrics and error logs.
  7. Communicate: Announce changes, timelines, and migration instructions.
  8. Clean up: Remove deprecated aliases after the announced date.

Exercises

Complete the exercises below. Use the checklists to self-verify. Solutions are available in collapsible panels.

  • Exercise 1: Plan and implement a safe metric change with deprecation.
  • Exercise 2: Add ownership, tests, and approvals to protect a shared definition.

Self-check checklist

  • I used additive changes or aliases first.
  • I wrote a short change plan with impacts, timeline, and rollback.
  • I included tests and validated results.
  • I specified who must approve the change.
  • I documented deprecation dates and communicated them.

Common mistakes

  • Mutating an existing definition without an alias or deprecation window. Fix: add a new name first.
  • Not informing dashboard owners. Fix: list impacted assets and message owners before merging.
  • Releases at risky times (end of day/week). Fix: release early in the day with monitoring.
  • Missing tests. Fix: add unit logic checks and schema tests for types/nullable.
  • No rollback plan. Fix: define how to revert and under what signals.
Quick self-audit before merging
  • Did I avoid breaking changes or provide a temporary alias?
  • Are tests passing and differences explained?
  • Do the right owners approve this PR?
  • Have I scheduled communication and set a clear deprecation date?

Practical projects

  • Create a shared semantic file for 3 core metrics (revenue_net, orders, aov). Add owners, tags, and tests.
  • Refactor one legacy dimension using an alias + deprecation pattern. Write the migration note.
  • Draft a team-wide “Change Plan” template with sections for risk, impact, rollout, and rollback.

Mini challenge

You discover a KPI used in the monthly exec deck has ambiguous logic. Propose a 4-step plan to clarify and migrate it without breaking the deck. Keep it concise.

Who this is for

  • BI Analysts and Analytics Engineers maintaining shared metrics/dimensions.
  • Analysts who own dashboards consumed by multiple teams.

Prerequisites

  • Basic Git: branches, commits, pull requests.
  • Comfort with SQL and reading model/semantic files (e.g., YAML).
  • Familiarity with your BI tool’s model/semantic concepts.

Learning path

  1. Version control basics: branching and PRs.
  2. Shared definitions: contracts and consumers.
  3. Tests and validation for metrics/dimensions.
  4. Change planning, deprecation, and communication.
  5. Release, monitor, and cleanup.

Next steps

  • Adopt a lightweight change plan template for any shared-definition PR.
  • Set default reviewers for high-impact files.
  • Automate a minimal test suite for your top 5 KPIs.

Quick Test

Anyone can take the test for free. Only logged-in users will see saved progress and history.

Practice Exercises

2 exercises to complete

Instructions

You need to change the existing revenue metric to exclude refunds. Create a safe, additive change plan and show the semantic change.

  1. Add a new metric revenue_net with the correct logic.
  2. Mark revenue as deprecated but keep it available for 2 weeks.
  3. Write a short change plan (impact, timeline, rollback).
  4. Provide a PR description snippet suitable for review.

Starter snippet:

metrics:
  - name: revenue
    sql: SUM(order_amount)
    label: Revenue
Expected Output
A semantic snippet showing revenue_net added; revenue marked deprecated; a 5–8 sentence change plan; and a PR description including rollback steps.

Managing Shared Definitions Safely — Quick Test

Test your knowledge with 7 questions. Pass with 70% or higher.

7 questions70% to pass

Have questions about Managing Shared Definitions Safely?

AI Assistant

Ask questions about this tool