如何定义维度,以便在显示所有值时不忽略 FK 中的空值?

How do I define a dimension so that null values in the FK are not ignored when showing all values?

我正在使用 Modrian Workbench 模式为 OLAP 多维数据集建模并使用 Jaspersoft 来呈现它。多维数据集建立在事实 table 的基础上,FK 的维度为 tables。 目前我的事实 table 具有维度的可空外键,我个人觉得这很有趣(而且,据我所知,是否使用可空 FK 只是样式决定(https://dba.stackexchange.com/questions/3512/fact-table-foreign-keys-null ).

The problem is that when selecting ALL States (State is a dimension in my design), I get only the records that have a state, not the records without states (in which the state id is null).

Mondrian是否能够获取没有state id信息的行?我该如何定义它?

我认为您必须使用不可为空的 FK 和 none / n/a / unknown 等成员,如果您希望 ALL 成员引用所有事实。

如果您以后想要编写仅考虑具有实际维度值的行的查询,您可以再次排除 none 成员。