Pregunta

I make payments to various kinds of payees and I'm wondering whether I should create a dimension of each kind of payee and have multiple foreign keys in my fact table, or conflate the various kinds of payees via a type attribute and have a single FK in the PaymentFact table at the expense of having attributes that make no sense in the PayeeDim table for any particular value of PayeeDim.Type...

how are these situations normally handled?

TIA - e

¿Fue útil?

Solución

As always with dimensional modeling, the answer is "It Depends." It's usually better to have a dimension with a bunch of empty attributes if the alternative is a fact table with 15-20 dimensions.

To the business, if a Payee is a payee, and there are several payee types, then it makes sense to have a payee dimension. But if a one payment record can be assocaited to multiple different "types" of payees, then each dim should get its own key on the fact.

Otros consejos

One option is to have two dimensions - one with the Payee information, and the other with the Payee_Type information.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top