# Same Table, Different Revenue: Apache Ossie and Snowflake to the Rescue

DevFeed: [Same Table, Different Revenue: Apache Ossie and Snowflake to the Rescue](<https://devfeed.tech/articles/same-table-different-revenue-apache-ossie-and-snowflake-to-the-rescue-129821.md>)

Original publisher: [Read original article](<https://medium.com/snowflake/same-table-different-revenue-apache-ossie-and-snowflake-to-the-rescue-a26e5c99f5c5?source=rss----34b6daafc07---4>)

Author: Daan Bakboord

Published: 2026-11-11T22:01:02Z

Content type: article

Language: en

Sources: [Snowflake Builders](<https://devfeed.tech/sources/snowflake-builders.md>)

Topics: [semantic-layer](<https://devfeed.tech/topics/semantic-layer.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [apache](<https://devfeed.tech/tags/apache.md>), [apache-ossie](<https://devfeed.tech/tags/apache-ossie.md>), [apache-software-foundation](<https://devfeed.tech/tags/apache-software-foundation.md>), [context](<https://devfeed.tech/tags/context.md>), [count](<https://devfeed.tech/tags/count.md>), [customer](<https://devfeed.tech/tags/customer.md>), [daanalytics](<https://devfeed.tech/tags/daanalytics.md>), [data-governance](<https://devfeed.tech/tags/data-governance.md>), [metric](<https://devfeed.tech/tags/metric.md>), [orders](<https://devfeed.tech/tags/orders.md>), [revenue](<https://devfeed.tech/tags/revenue.md>), [semantic](<https://devfeed.tech/tags/semantic.md>), [semantic-layer](<https://devfeed.tech/tags/semantic-layer.md>), [semantic-view](<https://devfeed.tech/tags/semantic-view.md>), [snowflake](<https://devfeed.tech/tags/snowflake.md>), [table](<https://devfeed.tech/tags/table.md>)

## AI overview

The demo shows how shared metric definitions prevent different tools from producing defensible but inconsistent revenue figures. On the sample orders, total_revenue sums amounts only for completed orders (103,200); other metrics use different rules, such as active_customers including completed, shipped, and processing orders. Apache Ossie (Incubating) expresses sources, relationships, dimensions, metrics, filters, and descriptions in a portable YAML contract; it does not execute queries. A Snowflake semantic view implements that contract with metric expressions and relationships so queries can request named metrics without restating their rules. Modeling join paths matters: grouping order revenue by customer region is safe, while joining orders to line items can duplicate order totals, so category analysis should use line-level revenue. The article presents this shared context as a way to keep dashboards, apps, and AI agents consistent, while noting that rules such as excluding open orders from category revenue must be built into the relevant metric.

## Source excerpt

Ask two tools for revenue from the same orders table and both can return a different, defensible number. Here is what that looks like in the demo. The difference is 12,350. Both queries read the same orders and do the arithmetic correctly. What changes is which orders qualify as revenue. In this demo, revenue counts only when an order is completed. Apache Ossie and a Snowflake semantic view make that rule explicit. That definition is context. It is the contract that tells a person, a dashboard, or an AI agent which reading of the table is allowed to be called revenue. Context is the contract A table stores values. Context says what those values mean when someone asks a business question. For a metric, the contract has a few parts: the expression, such as a sum or a count the rows that qualify, such as a status filter the entities it can be sliced by, and how those entities join the other metrics it is built from a description that a human and a model can both read Leave any of those out and the column name does the rest of the work. total_amount looks like revenue. It also looks like revenue before discounts, and like revenue that includes orders that never completed. An analyst picks one reading in a worksheet. A dashboard picks another. An agent, given the same column list, picks a third and sounds sure about it. The sample model shows the distinction with three metrics on the same orders table. total_revenue sums total_amount where order_status = 'completed'. On this data that is 103,200. gross_revenue uses the same completed orders and adds discount_amount back. Same orders, different question: value before the discount rather than after it. active_customers counts distinct customers with an order in completed, shipped, or processing. It is a wider rule than revenue. The two metrics can disagree. In this sample, the four open orders belong to customers who also have a completed order, so the customer count does not move. The next customer who has only a shipped