// SEMANTIC LAYER

Your semantic layer starts with your business model.

Daana generates the warehouse structures underneath your semantic layer. Connect what a metric means to the business model and source fields it comes from.

[ Follow one revenue metric ]

For the semantic layer you already use. For the BI tools and agents that query it.

REVENUE / DEFINITION TRACE01—03
01

BUSINESS

Amount charged

Tax-inclusive order-line amount

02

SOURCE

line_total

quantity × price − discount + tax

03

REPORTING

Daily revenue

Sum by order day + currency

ONE DEFINITION / THREE CONNECTED REGISTERS
// WHERE DAANA FITS

Declare the meaning.
Generate the foundation.

Daana generates reporting tables from your declarations. Your team connects those tables to your existing semantic layer and configures its metric definitions.

FROM DECLARATION TO QUERY

  1. 01 / DECLARE

    YOUR TEAM

    Business model + requirements

    Define the entities, source mappings and reporting grain.

    daily_revenue:
      kind: fact.consolidated
      grain: [order_date,
        order_line_amount_currency]
      spine: {driving: lines}
  2. 02 / GENERATE

    DAANA

    Reporting tables

    Daana generates the warehouse foundation from your declarations.

    fct__order_line_daily_revenue
  3. 03 / CONFIGURE

    YOUR TEAM

    Your existing semantic layer

    Connect the generated tables and align your metric definitions.

    Manual configuration + definition alignment
  4. 04 / QUERY

    BI TOOLS + AGENTS

    Daily revenue

    Query through the semantic layer your team configured.

    Your existing query stack
Daana generates the foundation. Your team owns semantic-layer configuration and definition alignment.
// READ THE DECLARATIONS

BOOKSTORE / ONE QUESTION

What does daily revenue actually count?

The amounts charged on order lines, tax included. Behind those two words are decisions about amount, event time, grain and currency.

Read the business model ↗

PUBLIC YAML / SELECTED FIELDS

SOURCE-TO-TARGET MAPPING

line_total → order_line_amount_amount

transformation_expression: line_total

MAPPING → EVENT TIME

order_date → eff_tmstp

entity_effective_timestamp_expression:
  (SELECT o.order_date FROM stage.sales_orders o
    WHERE o.order_id = sales_order_lines.order_id)

REPORTING → DAILY REVENUE

one row / day + currency

grain: [order_date, order_line_amount_currency]

MAPPING → CURRENCY

literal USD → lines’ currency

transformation_expression: &order_currency "'USD'"
Public bookstore declarations · excerpts, not a complete project.
// FIT IT TO YOUR STACK

Trace the meaning. Own the definition.

Start with one business area. Compare its metric definitions with the declared model. Where they disagree, decide which one is the definition and make the other refer to it, so each metric has one owner, whether people query it through a BI tool or a text-to-SQL agent.

MODEL.YAML / ORDER_LINE_AMOUNT

“Amount charged for the line, tax included”

Column-level lineage shows which fields feed a result. The business model, source contracts and mappings also explain what the result means: its calculation, grain, time basis and relationships.

Why context alone is not enough
  1. 01Agree the definition and metric grain with the people who use it.
  2. 02Declare the model, mappings and reporting requirements.
  3. 03Point your semantic layer at the resulting tables. Keep its definitions aligned.