SAP BW: Replacement Path Variables
How to use Replacement Path Variables to perform Date Calculations
A Step-by-Step guide
Have you ever wanted to perform calculations using dates defined as characteristics but have never worked out how it can be done? Replacement Path Variables are the key.
Using Replacement Path in your Text and Formula variables, replace values held in a characteristic. The Characteristic value variables are replaced by the results of a query at run-time.
The steps detailed below show a technique to enable a BEx query user to determine the number of days between two dates.
Scenario:
The group HR administrator wants a detailed line item report that lists all employee absences in a given period. The report is to show the employee number, the absence start date, together with the end date of the absence and show the number of calendar days the employee was absent.
The good thing about using this technique is that no redesign work is needed from your technical BW team, no ABAP is involved and best of all, it quick and easy.
Solution:
For this example I created an ODS object called Absence that holds basic employee information along with individual absence record data.
Follow the steps below:
- Open the BEx Query Designer and create a new report on your chosen InfoProvider.
- Drag the Employee, Valid from and Valid to characteristics into the Rows section of the screen. If needed, apply data selection restrictions to the characteristics as shown in Figure 1.
- Right click on the Key Figures structure and select New Formula (Figure 1).
Figure 1 - In the new formula window right click on Formula Variable and choose New Variable ( Figure 2 ).
Figure 2 - The Variables Wizard will launch and will require you to specify the variable details.
( Click the NEXT button if the Introduction screen appears ) - Enter the variable details on the General Information as shown in Figure 3 .
Enter the Variable Name , Description and select Replacement Path in the Processing by field.
Click the Next Button.
Figure 3 - In the Characteristic screen (Figure 4) select the date characteristic that represents the first date to use in the calculation (From Date).
Click the Next Button.
Figure 4 - In the Replacement Path screen (Figure 5) select Key in the Replace Variable with field. Leave all the other options as they are (The offset values will be set automatically).
Click the Next Button.
Figure 5 - In the Currencies and Units screen (Figure 6) select Date as the Dimension ID.
Click the Next button.
Figure 6 - The Save Variable screen (Figure 7) displays a summary of the new variable.
Click on the Finish button to save the variable.
Figure 7 - Repeat steps 4 to 11 to create a second variable for the second date to be used in the calculation. In the example shown, the characteristic 0DATETO is used to create the variable ABSEND (Absence End Date).
Define the Calculation
We can now use our two new replacement variables to define our new calculated key figure that generates the number of absence days for each record.
- You will now be back at the New Formula screen (Figure 8). Drag and drop the two new variables into the formula section of the screen and insert the subtract sign (“-“) between the two.
- Give the new formula a description and click the formula syntax check button
to ensure the formula is valid.
Figure 8 - The new calculated key figure will now show in the columns section of the BEx query designer (Figure 9).
Figure 9 - Save the query and execute it.
In the example shown the Number of Calendar Days Absent is calculated correctly. See the table of results below.
| Employee | Valid From | Valid To | Number of Calendar Days Absent |
|---|---|---|---|
| 50000001 | 17/04/2004 | 21/04/2004 | 4 |
| 50000002 | 16/07/2004 | 29/09/2004 | 13 |
| 50000003 | 07/01/2004 | 09/02/2004 | 33 |
| 50000004 | 04/08/2004 | 05/08/2004 | 1 |
SAP BW: Replacement Path Variables的更多相关文章
- SAP BW标准模型简介(BW星形模型 BW Star Schema )
标准星型模型是 数据仓库中一种常用的组织信息和数据的多维数据模型.它由中心的一个事实表(Fact Table)和一些围绕它的维度表(Dimensional Table)组成. 事实(Fact)着眼于 ...
- SAP BW 数据库表命名规则
SAP BW 数据库表命名规则 已有 315 次阅读2012/6/8 15:55 |系统分类:专业内容| SAP, 命名, 数据库表 Namings for Cube: /BI<C OR DIG ...
- 应用SAP PI实现SAP BW数据仓库对于第三方系统数据完美集成以及DELTA加载的分析
注明:本篇的技术性细节参考了SAP SCN上的一篇SAP PI 和BW集成的文章,本篇文章并不打算过多探讨实现的技术细节,因为在SCN上的这篇英文文章已经完全涵盖了技术细节和配置步骤 大家可以通过搜索 ...
- 【BW系列】SAP BW on HANA 迁移问题
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[BW系列]SAP BW on HANA 迁移问 ...
- 【BW系列】SAP BW实时抽取ECC数据的实现
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[BW系列]SAP BW实时抽取ECC数据的实现 ...
- Idea | Load error: undefined path variables
Load error: undefined path variables 案例 今天打开idea项目,突然间出现如下异常: Load error: undefined path variables 类 ...
- SAP BW顾问如何保持市场竞争力
跟大部分电工一样,SAP顾问也经常有迷茫的时候.因为,这个世界变化实在太快了.每一个电工,总是在担心自己会不会被飞速发展的技术所淘汰.那么,作为 一个BW顾问,应该如何保持市场竞争力呢?我觉得需要两个 ...
- SAP BW中的增强(转)
根据所了解的资料,BW中的有关增强可分为五部分,如下: 1. 数据抽取增强,即在标准数据源中加入数据源中所不存在的字段,或者标准数据源不存在所需数据而需要自定义数据源,相关的事务代码有RSO2(用于 ...
- 【转】SAP BW 顾问靠手 — SAP中的例程
什么是例程(Routine)? 例程就是我们可以自己定义的程序代码.通过程序代码来完成我们的需求,因为业务是千变万化,如果想让产品能跟随上业务的脚步,就必须要有非常灵活的功能来补充.大家都知道软件产品 ...
随机推荐
- poj 1797 最大最小路段【dijkstra】 (经典)
<题目链接> 题目大意: Hugo Heavy要从城市1到城市N运送货物,有M条道路,每条道路都有它的最大载重量,问从城市1到城市N运送最多的重量是多少. 解题分析: 感觉这道题用dijk ...
- go语言爬虫 - TapTap用户都喜欢些什么游戏
前面的废话 说到爬虫,首先想到的当然是python~ 它在机器学习.爬虫数据分析领域可谓是如日中天,十分热门.但我最近在学习go语言,所以就用go写了 TapTap社区 这是一个高品质的游戏分享社区, ...
- sql注入总结(一)--2018自我整理
SQL注入总结 前言: 本文和之后的总结都是进行总结,详细实现过程细节可能不会写出来~ 所有sql语句均是mysql数据库的,其他数据库可能有些函数不同,但是方法大致相同 0x00 SQL注入原理: ...
- BZOJ.4653.[NOI2016]区间(线段树)
BZOJ4653 UOJ222 考虑二分.那么我们可以按区间长度从小到大枚举每个区间,对每个区间可以得到一个可用区间长度范围. 我们要求是否存在一个点被这些区间覆盖至少\(m\)次.这可以用线段树区间 ...
- 洛谷.3391.[模板]文艺平衡树(Splay)
题目链接 //注意建树 #include<cstdio> #include<algorithm> const int N=1e5+5; //using std::swap; i ...
- [NOIp2013普及组]车站分级
思路: 对于每一趟车,将区间内所有经停的站和所有未经停的站连一条边,表示前者优先级一定高于后者,然后用Kahn跑一遍拓扑排序即可.然而这样会创造大量多余的边,会TLE1个点.考虑一种优化:因为每趟车本 ...
- 使用time模块,转化时间格式
import time ''' 时间戳:表示1970年开始计算的偏移量.我们运用type(时间戳)是float类型 结构化时间:9个元素组成的数组 格式化时间字符串 ''' '''获取当前时间戳''' ...
- bootsrap中的输入框demo1
<!doctype html><html > <head> <meta charset="utf-8"> <link rel= ...
- Convert a VMDK (VMWare) file to VHDX (Hyper-V)
https://www.meziantou.net/2016/09/09/convert-a-vmdk-vmware-file-to-vhdx-hyper-v Microsoft provides a ...
- bzoj 1076 状态压缩最优期望
题意: 你正在玩你最喜欢的电子游戏,并且刚刚进入一个奖励关.在这个奖励关里,系统将依次随 机抛出k次宝物,每次你都可以选择吃或者不吃(必须在抛出下一个宝物之前做出选择,且现在决定不吃的宝物以后也不能再 ...