【发布时间】:2015-07-02 23:14:44
【问题描述】:
我正在使用 mondrian 模式中的角色,我想知道是否可以使两个声明的角色相交。
我创建了这些角色:
适用于对特定产品类型有限制的产品经理
<Role name="product_manager">
<SchemaGrant access="none">
<CubeGrant cube="product" access="all">
<HierarchyGrant hierarchy="product_group" rollupPolicy="partial" access="custom">
<MemberGrant member="[product_group].[Wardrobes]" access="all">
</MemberGrant>
</HierarchyGrant>
</CubeGrant>
</SchemaGrant>
</Role>
以及对特定国家有限制的财务经理
<Role name="financial_manager">
<SchemaGrant access="none">
<CubeGrant cube="country" access="all">
<HierarchyGrant hierarchy="country" rollupPolicy="partial" access="custom">
<MemberGrant member="[country].[Germany]" access="all">
</MemberGrant>
</HierarchyGrant>
</CubeGrant>
</SchemaGrant>
</Role>
我需要的结果应该是这两个角色的交集,我发现存在元素 UNION,但我发现它返回两者的总和,因此用户可以从两者中看到所有内容,它不是我需要的解决方案。
<Role name="product_and_financial_manager_for_wardrobes_and_germany_resort">
<Union>
<RoleUsage roleName="product_manager" />
<RoleUsage roleName="financial_manager" />
</Union>
</Role>
类似这样的:
<Role name="product_and_financial_manager_for_wardrobes_and_germany_resort">
<Intersection>
<RoleUsage roleName="product_manager" />
<RoleUsage roleName="financial_manager" />
</Intersection>
</Role>
这是关于数据的示例:
fact_product
---------------------------------------------------------------------------
| id_fact_product | price | id_dim_product_group | id_dim_country
---------------------------------------------------------------------------
| 1 | 100 | 1 | 1
---------------------------------------------------------------------------
| 2 | 150 | 1 | 2
---------------------------------------------------------------------------
| 3 | 120 | 2 | 2
---------------------------------------------------------------------------
| 4 | 230 | 1 | 2
---------------------------------------------------------------------------
dim_product_group
----------------------------------------------
| id_dim_product_group | section
----------------------------------------------
| 1 | Wardrobes
----------------------------------------------
| 2 | Tables
----------------------------------------------
dim_country
----------------------------------------------
| id_dim_country | country
----------------------------------------------
| 1 | Italy
----------------------------------------------
| 2 | Germany
----------------------------------------------
product_and_financial_manager_for_wardrobes_and_germany_resort 角色的结果应仅查看此范围内的数据
-----------------------------------------------------------------------------
| id_fact_product | price | id_dim_product_group | id_dim_country
---------------------------------------------------------------------------
| 2 | 150 | 1 | 2
---------------------------------------------------------------------------
| 4 | 230 | 1 | 2
---------------------------------------------------------------------------
----------------------------------------
| section | country |
-----------------------------------
| Wardrobes | Germany |
-----------------------------------
| Wardrobes | Germany |
-----------------------------------
感谢您的帮助
【问题讨论】: