简体   繁体   English

事实表加载方法

[英]Fact Table Load Approach

I created enclosed data model based on star schema, i have loaded all the dimensions but trying to figure out a way to load fact table. 我根据星型模式创建了封闭的数据模型,我已经加载了所有维度,但是试图找出一种加载事实表的方法。

My confusion here is with the foreign keys for eg I have about 6787 records from "Manufacturer" ie ManfID table but there are about 50 K records from "Dim_Transactions" ie Transaction ID 我对这里的外键感到困惑,例如,我从“制造商”(即ManfID表)中获得了约6787条记录,但是从“ Dim_Transactions”(即交易ID)中获得了约5万条记录

Not sure how this would be stored on Fact table, is this a design flaw ? 不确定如何将其存储在Fact表上,这是设计缺陷吗? How can I fix this ? 我怎样才能解决这个问题 ?

I think this can be managed by having multiple values across all keys for eg there will be 50K fact record with other keys repeating themselves. 我认为可以通过在所有键上具有多个值来管理此问题,例如,将有50K事实记录,而其他键会重复自己。

If that is so how would I load the fact table, I am using SSIS here and have also created lookup files to uniquely identify Primary Key using other columns 如果是这样的话,我将如何加载事实表,我在这里使用SSIS,并且还创建了查​​找文件以使用其他列唯一地标识主键。

在此处输入图片说明

Get rid of dim_Transactions. 摆脱dim_Transactions。 The embedded dimensions for branch and region exist elsewhere. 分支和区域的嵌入维存在于其他位置。 Aggregate the Approved, Declined, and Reversal CashAmt columns as measures in Fact_ATM if you need them. 如果需要,将批准,拒绝和冲销CashAmt列汇总为Fact_ATM中的度量。

Sometimes people keep a copy of the transaction table in the data warehouse or staging database for audit or reporting, but there is no reason to put it in a star schema. 有时人们将事务表的副本保留在数据仓库或登台数据库中以进行审计或报告,但是没有理由将其放在星型模式中。

In a way, and I'll get a load of grief for this, a transaction can be viewed as a fact table at the finest possible grain. 从某种意义上讲,我会为此感到忧虑,可以将事务视为事实表,但要尽可能多。 But transactions represent an atomic event and I can't think of how one could inhabit a dimension. 但是交易代表了一个原子事件,我想不出如何占据一个维度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM