Warm tip: This article is reproduced from serverfault.com, please click

Best practice to design fact table rollups for BI's Aggregate Navigation

发布于 2021-04-08 11:03:00

I am trying to implement fact table and its rollups the right way, to be able one day to transfer it to some BI system

And, based on Oracle's article and KimballGoups's article, as I understand, whole design must obey strict principles

So, suppose there is a table fact_sales:

-----------------------------------------
| dim_store | dim_product | total_sales |
-----------------------------------------
|         1 |           1 |          10 |
|         1 |           2 |          20 |
|         2 |           3 |          20 |
-----------------------------------------

Suppose, there is a need to make another table, rolled up by store, omitting product column, so, it'll look like this, fact_sales_by_store:

---------------------------
| dim_store | total_sales |
---------------------------
|         1 |          30 |
|         2 |          20 |
---------------------------

And, as I guess, things are not that simple, and to make BI's Aggregate Navigation work properly, there must be some trick in dimensions, but I can not get it from articles

As I see/guess, beetween dims and fact table must be some "Logical Table Source", or some hierarchy dims?

Can you please point me further based on that example?) Big thx

Questioner
MaxCore
Viewed
0
Mike Honey 2021-04-11 14:09:55

For any modern BI app (e.g. Power BI), I would not create aggregate tables at all. The BI app used should be capable of aggregating data flexibly, by any combination of dimensions.

There might be more complex requirements than what you outlined, that justify creating two fact tables with differing grain/granularity. In that scenario, a capable BI tool can pull together aggregates from two fact tables for a single output dataset/visual. The unifying factor would be any common dimension tables.