Why NULL values are mapped as 0 in Fact tables?

后端 未结 4 1961
深忆病人
深忆病人 2020-12-21 00:40

What is the reason that in measure fields in fact tables (dimensionally modeled data warehouses) NULL values are usually mapped as 0?

4条回答
  •  旧巷少年郎
    2020-12-21 01:16

    It depends upon what you're modeling, but in general it's to avoid complications with performing aggregates. And in many scenarios it makes sense to treat NULL as 0 for those purposes.

    For example, a customer with NULL orders for a given period of time. Or a sales person with NULL sales revenue (shame on him!).

提交回复
热议问题