Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Design patterns OLAP多维数据集设计:运行时生成的度量_Design Patterns_Olap_Mondrian - Fatal编程技术网

Design patterns OLAP多维数据集设计:运行时生成的度量

Design patterns OLAP多维数据集设计:运行时生成的度量,design-patterns,olap,mondrian,Design Patterns,Olap,Mondrian,我面临的一个需求是,我不能完全肯定这可以通过纯OLAP设计实现(无论如何,我的OLAP知识太少) 我有一个维度表,例如 DROP TABLE IF EXISTS TMP_DEBUG_OLAP_44_BUILDING; CREATE TABLE TMP_DEBUG_OLAP_44_BUILDING AS SELECT 1 AS building_id,'Building 1' AS building_name UNION ALL SELECT 2 AS building_id,'Building

我面临的一个需求是,我不能完全肯定这可以通过纯OLAP设计实现(无论如何,我的OLAP知识太少)

我有一个维度表,例如

DROP TABLE IF EXISTS TMP_DEBUG_OLAP_44_BUILDING;
CREATE TABLE TMP_DEBUG_OLAP_44_BUILDING AS
SELECT 1 AS building_id,'Building 1' AS building_name
UNION ALL
SELECT 2 AS building_id,'Building 2' AS building_name
;
以及表事实(事实-1),例如

以及因子转换事实表(事实-2),例如

我被要求为每个元组生成一个度量值[Measures].[Budget amount]\u vs\u country,这样它就可以在fact-2的每个元组中添加一个度量值,乘以[Measures].[Budget amount]*factor\u值

示例:fact-table-1第一行是building_id=1,我需要3个度量值:[度量值].[预算金额]、Budget-amount1.0(DK)和Budget-amount1.5(MX)

现在,如果将另一个国家添加到表中,则会有一个新的元组,因此会有一个新的度量值

有没有什么方法可以在不修改多维数据集的情况下实现这一点


谢谢和问候

看起来您的预算度量是半累加性度量,因为它在建筑维度上是累加的,而在国家维度上不是累加的。半累加性度量通常通过计算度量来解决。

您的预算度量看起来是半累加性度量,因为它在建筑维度上是累加的,而在国家维度上不是累加的。半加性度量通常通过计算的度量来解决。

或者,如果有一种方法可以通过输入参数来获得单个度量,并且将系数应用于所选国家,则就足够了。然而,我的explotation平台是JPivot,它缺乏用户输入的能力。或者,如果有一种方法可以通过输入参数获得一个单一的测量值,将系数应用于所选国家,就足够了。然而,我的爆炸平台是JPivot,它缺乏用户输入的能力。
DROP TABLE IF EXISTS TMP_DEBUG_OLAP_44_FACTS;
CREATE TABLE TMP_DEBUG_OLAP_44_FACTS AS
SELECT 1 AS building_id,10 AS budget_amount,11 AS estimate_amount
UNION ALL
SELECT 2 AS building_id,12 AS budget_amount,13 AS estimate_amount
;
DROP TABLE IF EXISTS TMP_DEBUG_OLAP_44_FACT_FACTORS;
CREATE TABLE TMP_DEBUG_OLAP_44_FACT_FACTORS AS
SELECT 'DK' AS country_id,1.0 AS FACTOR
UNION ALL
SELECT 'MX' AS country_id,1.5 AS FACTOR
;