Oracle Essbase入门系列(四)

本文介绍了维度成员的六种存储类型:Store、DynamicCalc、DynamicCalcAndStore、LabelOnly、Shared 和 NeverShare,并通过实例展示了如何利用这些存储类型来满足特定的业务需求。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

成员存储类型

除了大纲计算,维度成员的另一项重要属性是存储类型,存储类型决定维度成员相关单元格的物理存储方式。在维库中编辑成员的【Data Storage】属性,下拉菜单中可选的5种,再加上Shared成员,一共6种存储类型。

Store:储存数据。当一个单元格所有成员的存储类型都是Store时,单元格的数据会物理存储。前面说明输入单元格和计算单元格时,似乎存在这样的印象——非0级和带有成员公式的单元格都是不可输入的,必须由子代成员合并或公式计算得到。其实不然,决定单元格是否“可输入”是由存储类型决定的。Store类型的单元格都可输入数据,只不过在执行了计算后被输入数据会被计算结果覆盖。

DynamicCalc:动态计算。相关单元格不存储数据,仅在查询时即时计算。动态计算的成员必须定义计算方法,非0级成员可以通过子代成员合并,0级成员必须有成员公式。使用动态计算的目的,一是可以减少存储空间,二是可以阻止在单元格上输入数据。但如果查询中包含有动态计算成员时,会延长查询响应时间。

DynamicCalcAndStore:动态查询和存储。当第一次查询或数据被标识为脏时,即时计算,计算结果会保存下来,后续查询中就可以使用存储的数据。相比起DynamicCalc,DynamicCalcAndStore平衡了查询性能和存储空间。

LabelOnly:仅标签。既不计算,也不存储数据。仅在层次中作为分组或分级的标签存在。查询LabelOnly成员时,通常显示第一个子成员的数据。

Shared:共享成员。共享成员是对同维度中同名成员的引用,其数据来自于被引用成员。如果在维度中多个地方使用同一成员,可以使用共享成员。例如,Account维度中收入和支出在净收入的成员公式中被引用,可以使用共享成员来实现同样的计算。如图设计大纲,净收入下的共享成员引用了同维度中的支出与收入,按照合并计算符,可以代替成员公式的计算方法。在维库中要加入共享成员,可右击某一成员,在右键菜单中选【插入共享成员】>【作为子代】或【作为同级】。

NeverShare:不共享数据。除了使用Shared类型来显示的定义共享成员外,Essbase中还有些成员是隐式共享。参考图3-48的维度结构,Home成员值实际上等于张大明成员值。Essbase能识别这种关系,并自动将张大明作为Home的共享成员,此称为隐式共享。为了避免隐式共享,可以将Home的存储类型置为NeverShare。

例:张大明家需要制定2013年的家庭预算,在Year维度上,只需做月度收支计划,无需细化到每一日;Home维度上,全家的预算分配到个人时,保留一部分机动资金。还需要定期核对预计收支目标和实际收支间的差异,实际支出应该小于目标支出,实际收入应该大于目标收入。如表是1月的预算与实际收支数据。

此例要求数据库可在Year、Home、Account维度的非0级成员上输入数据,所以首先确保表中相关维度成员的存储类型必须是Store。

由于机动资金,Home成员的支出是要大于子成员支出的总和。而且,要求在Year维度中,就算在日级成员中误输入了数据,也不会影响到月级成员的数据。所以在计算时,非0级成员的输入数据不能被子代成员的合并计算结果覆盖。为此将Scenario维度下预算的合并计算符设为“^”,则预算相关的所有单元格都不使用合并计算符计算。

但同时又希望在Time维度上将月度预算能汇总到季度,再汇总到全年。编辑数据库的默认计算脚本,如下:

接着来看表中差异项的定义,差异是实际和预算的差值,但支出和收入有不同的计算方向。对支出来说,实际小于预算为优,差异等于预算减实际;对收入来说,实际大于预算为优,差异等于实际减预算。这种计算方式可使用费用报告计算(Expense Reporting)功能,费用报告是除了时间平衡外,Account类型维度另一个特有的计算属性。通过将Account维度的成员标注为费用或非费用类型,可控制在@VAR和@VARPER函数中的计算方向。

在维库中将支出及其子成员的【Expense Reporting】属性设置为Expense;收入及其子成员为默认的NonExpense。修改差异的存储类型设为DynamicCalc,成员公式设为:

至此,HomeFinancial数据库已基本满足了例子中提出的需求。将这两节中的修改汇总,数据库模型最终的结构如下:

维度结构:

成员公式:

默认计算脚本:

在维库中检查HomeFinancial应用程序是否都如上修改,如无问题部署到Essbase Server。EPMA目前还无法编辑Essbase计算脚本,因此部署后再修改默认计算脚本。

Essbase Database Administrator's Guide, 11.1.2.2.100 Copyright © 1996, 2013, Oracle and/or its affiliates. All rights reserved. Authors: EPM Information Development Team Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government. This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications. This software or hardware and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值