Combine 2 facts in a cube?

Is it possible to combine 2 fact tables to create a cube in the Mondrian scheme, sales example and cost ?

+4
source share
2 answers

As a rule, in one fact table there are both indicators of sales and costs, and add them as measures in one cube.

If you cannot have them in a single fact table, they must have common dimensions, so you can combine them in a Virtual Cube (before Mondrian 3.8). Usual time size:

DHW

  • Fact_sales table: date_key, ..., sales
  • Fact_cost table: date_key, ..., cost
  • Table dim_date: date_key, day_of_month, month, year, ...

Mondrian OLAP Scheme

  • []: dim_date, date_key, year, ...
  • Cube [Sales]: fact_sales, [] date_key, sales
  • Cube [Cost]: fact_sales, [] date_key, cost
  • [Sales and Cost]: [Date], [Sales.sales], [Cost.cost]
+4

Mondrian 4, SQL, . , :

 <PhysicalSchema>
    <Query alias="FACT">
        <ExpressionView>
            <SQL dialect="generic">
                select f.*, f2.measure_2 from FACT f INNER JOIN FACT2 f2 ON f.id = f2.fact_id
            </SQL>
        </ExpressionView>
    </Query>
</PhysicalSchema>

. : http://thejavatar.com/mondrian-4-in-pentaho-bi-server/

+4

All Articles