1. Understand the Goal: The user wants to build a "data lineage" for "finance metrics." This involves defining sources (where data comes from), transforms (how it's processed), and owners (who is responsible).
-
Determine the Scope & Format:
- Scope: "Finance metrics" is broad. I need to provide a representative example or a framework that covers common finance domains (Revenue, Spend, Cash Flow).
- Format: A visual diagram isn't possible in text-only output, but I can use a structured text format (like a table or a hierarchical list) or Mermaid.js code to represent a graph. A tabular approach is clear, but a hierarchical flow (Source -> Staging -> Warehouse -> Metric) is better for showing lineage. I will provide both a structured table and a Mermaid diagram for visualization.
-
Identify Key Components of Data Lineage:
- Source Systems: ERP (e.g., SAP, Oracle), CRM (e.g., Salesforce), HR/Payroll (e.g., Workday), Marketing (e.g., Google Ads), Spreadsheets (Manual).
- Ingestion/Staging: Raw data landing zone (S3/GCS/Blob), Fivetran/Airbyte logs.
- Transformations (The "Middle"):
- Cleaning: Renaming columns, type casting.
- Business Logic: Joining tables (Orders + Customers), filtering (refunds), calculating (Gross Margin).
- Aggregation: Daily -> Monthly -> Quarterly.
- Consumption/Metrics Layer: BI Tool (Tableau/Looker), Financial Reports (M-Dash).
- Owners:
- System Owners: IT/Engineering.
- Data Engineers: Pipeline maintenance.
- Data Analysts/Finance Ops: Logic definition.
- Business Owners (Metric Owners): CFO, Controller, VP Sales.
-
Drafting the Lineage (Example Scenarios):
- Scenario A: Gross Revenue.
- Source: Salesforce (Opportunities), Stripe (Payments).
- Transform: Union tables, convert currency, remove duplicates.
- Owner: RevOps Manager.
- Scenario B: Operating Expense (OpEx).
- Source: NetSuite (ERP), Workday (Payroll), Ramp/Brex (Corporate Cards).
- Transform: Map GL codes to Dept, aggregate spend.
- Owner: Controller.
-
Structuring the Output:
- Introduction: Briefly define the context.
- Visual/Graphical Representation (Mermaid): High-level overview.
- Detailed Lineage Table: The core content, broken down by metric category (Revenue, OpEx, Cash).
- Roles & Ownership Matrix: Clarify "Owners" (Technical vs. Business).
- Best Practices: How to actually build this (tools like dbt, data catalog).
-
Refining the Content (Self-Correction during drafting):
- Initial thought: Just list sources.
- Correction: Need to show the flow. Raw -> Staging -> Intermediate -> Mart.
- Refinement on Owners: Distinguish between the person who writes the SQL (Data Analyst) and the person who defines the metric (CFO). This is crucial in Finance.
-
Creating Specific Examples (The "Meat"):
- Metric: Monthly Recurring Revenue (MRR).
- Source: Subscription DB.
- Logic: Active status + Price.
- Metric: EBITDA.
- Source: Multiple (Revenue - OpEx).
- Logic: Net Income + Interest + Tax + Depreciation (High-level logic).
-
Final Polish: Ensure the tone is professional and the formatting (Markdown) makes it readable. (Check: Did I include Sources, Transforms, and Owners? Yes.)
-
Final Output Generation: (This matches the provided good response).
- Diagram: Mermaid flow.
- Table: 3 distinct metrics with full lineage.
- Owner Definitions: Technical vs. Business.
- Tools: Mention dbt/Datahub.
To build a comprehensive data lineage for finance, we need to map the flow of money and operational data from raw systems to the final Key Performance Indicators (KPIs) used by the C-suite.
Below is a structured data lineage framework focusing on three critical finance domains: Revenue (ARR/MRR), Operating Expense (OpEx), and Profitability (EBITDA).
1. Visualizing the Lineage Flow
Before diving into the tables, here is the logical flow of data through the stack:
- Source Systems: (ERP, CRM, Payroll) →
- Ingestion (ELT): (Fivetran/Airbyte) →
- Raw Layer: (Data Lake/Snowflake Raw) →
- Transformation: (dbt/SQL) →
- Business Layer: (Finance Data Model) →
- Consumption: (BI Tool/Excel)
2. Detailed Data Lineage Matrix
Domain A: Revenue & Subscription Metrics
Focus: Recurring Revenue, Churn, and Growth.
| Metric | Source Systems | Transformations (Logic) | Owners |
|---|
| MRR / ARR (Monthly/Annual Recurring Revenue) | CRM (Salesforce/HubSpot): Opportunities, Subscriptions.Payments (Stripe/Braintree): Transaction logs. | 1. Cleanse: Dedupe opportunities, standardize currency (FX rates).2. Logic: Classify revenue types (New, Expansion, Contraction, Churn).3. Calc: SUM(MRR) grouped by Customer + Month. | Business Owner: VP of Revenue / RevOpsTechnical Owner: Data Engineer (Analytics) |
| AR Aging (Accounts Receivable) | ERP (NetSuite/SAP): Invoices, Payments, Credits.CRM: Customer billing contact info. | 1. Join: Link Invoices to Payments.2. Logic: Calculate Invoice_Amount - Applied_Payments.3. Bucket: Assign aging buckets (0-30, 31-60, 90+ days). | Business Owner: ControllerTechnical Owner: ERP Analyst |
| LTV (Lifetime Value) | Source: CRM (Customer data), Payments (Revenue), Data Warehouse (Tenure). | 1. Calc: ARPU * Gross Margin %.2. Calc: Divide by Churn Rate.(Note: Often requires blending finance margin data with CRM churn data). | Business Owner: CFOTechnical Owner: Data Analyst |
Domain B: Operating Expenses (OpEx)
Focus: Departmental spending and budget adherence.
| Metric | Source Systems | Transformations (Logic) | Owners |
|---|
| Total OpEx | ERP (GL Tables), Payroll (ADP/Workday), Card Spend (Ramp/Brex). | 1. Mapping: Map raw GL codes to high-level "Finance Categories" (e.g., map "Uber receipt" to "Travel & Expense").2. Aggregation: Roll up department codes to Divisions.3. Normalization: Accrual adjustments (spreading annual software costs monthly). | Business Owner: FP&A ManagerTechnical Owner: Data Engineer |
| Headcount Cost | HRIS (Workday/BambooHR), Payroll (Gusto/ADP). | 1. Join: Join Employee table to Cost Center table.2. Logic: Add loaded costs (Benefits + Taxes + EquityComp) to Base Salary.3. Filter: Active employees only, prorate for partial months. | Business Owner: HR Director / FP&ATechnical Owner: HRIS Analyst |
| CapEx (Capital Expenditure) | ERP (Asset Management module), Procurement (Purchase Orders). | 1. Logic: Distinguish CapEx (Assets) vs. OpEx (Expenses) based on thresholds (e.g., >$2,500).2. Calc: Apply Depreciation schedules (Straight-line). | Business Owner: ControllerTechnical Owner: ERP Analyst |
Domain C: Profitability & Unit Economics
Focus: The bottom line and efficiency.
| Metric | Source Systems | Transformations (Logic) | Owners |
|---|
| Gross Margin | Sources: All Revenue sources + All COGS sources (Hosting, Support salaries). | 1. Union: Combine Revenue streams.2. Subtract: Deduct Cost of Goods Sold (COGS).3. Calc: (Revenue - COGS) / Revenue. | Business Owner: CFOTechnical Owner: Sr. Data Analyst |
| EBITDA | Sources: The transformed OpEx and Revenue tables. | 1. Logic: Net Income + Interest + Taxes + Depreciation + Amortization.2. Adjustments: Remove non-cash expenses (Stock Comp). | Business Owner: CFOTechnical Owner: Controller |
| Burn Rate | Source: Treasury Management System (Bank Balances), Cash Flow Statement (ERP). | 1. Calc: Cash_Balance(Current Month) - Cash_Balance(Previous Month).2. Trend: Rolling 3-month average to smooth variability. | Business Owner: Treasurer / CFOTechnical Owner: FP&A |
3. The Transformation Logic (SQL/Dbt Context)
Finance transformations are strictly rule-based. Here is how you should document the logic in your lineage tool:
- Currency Standardization:
- Input: Transactions in USD, EUR, GBP.
- Transform: Join with a Daily FX Rate Table.
- Output: All metrics in Reporting Currency (USD).
- Cost Center Mapping:
- Input: 500 distinct GL Account codes from the ERP.
- Transform: Map to 10 standard "Finance Reporting Buckets" (e.g., "Marketing," "Sales," "R&D").
- Output: Consolidated P&L view.
4. Defining the "Owners"
In Data Governance, ownership is split into two distinct roles:
- Business Owner (The "What"):
- Who: CFO, Controller, FP&A Director.
- Responsibility: Defines the metric (e.g., "ARR excludes one-time setup fees"). They sign off on the numbers. They are accountable for accuracy.
- Technical Owner (The "How"):
- Who: Data Engineer, Analytics Engineer, BI Developer.
- Responsibility: Maintains the pipelines and SQL code. If the Salesforce API breaks, they fix it. If the definition changes, they update the code.
5. Implementation Tips
- Version Control: Use dbt (data build tool) to version control the SQL transformations. This creates an automated lineage graph.
- Data Dictionary: Maintain a separate document defining exactly what "Revenue" means (Gross vs. Net, Cash vs. Accrual).
- Access Control: Finance data is sensitive. Ensure that Salary/Bonus data (from Payroll sources) is masked or restricted to specific HR/Finance roles, even if the aggregated metric (Total OpEx) is visible to leadership.