上个月的数据应在下个月汇总

2020-08-30 04:06发布

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


嗨,

我编写了一个BPC逻辑脚本来汇总下个月的上个月数据。 我有一个包可以执行此BPC逻辑脚本。 例如。 当我执行6月的数据包时,结果应为5月数据(即4月+ 5月)+ 6月数据。

进行汇总的数据保存在 Dummy_test 关键指标中。

AMT 键值具有原始 月数据。

在执行以下逻辑脚本时,例如 对于6月份,原来在6月份存在的记录将与5月份的数据相加。 因此May + June不会在6月添加May数据(A1 E2 100)的新条目。 而是显示如下单个记录

AMT的6月数据:

A1 E1 100

Dummy_test关键数据上的五月数据:

A1 E2 100

A1 E1 100

发布执行脚本:

Dummy_test Keyfigure上的6月数据:

A1 E1 200

预期输出:

Dummy_test Keyfigure上的6月数据:

A1 E1 200

A1 E2 100

我必须在下个月做一个简单的上个月加法。 请帮忙!

 * XDIM_MEMBERSET APL_TIMES =%APL_TIMES_SET%
 * XDIM_MEMBERSET APL_CATEGORY = DUMMY
 * XDIM_MEMBERSET APL_KEYFIGURE = AMT,虚拟测试
//* XDIM_MEMBERSET MEASURES = PERIODIC


 * SELECT(%Y%,YEAR,APL_TIMES,ID =%APL_TIMES_SET%)
 * SELECT(%1%,MONTHNUM,APL_TIMES,ID =%APL_TIMES_SET%)
 * SELECT(%N%,MONTHNUM,APL_TIMES,ID = TMVL(+ 1,%APL_TIMES_SET%))


 *当APL_CATEGORY
 *是假人
 *当APL_TIMES.MONTHNUM
 * IS 1
 * REC(EXPRESSION =%VALUE%,APL_TIMES =%Y%.04,APL_KEYFIGURE = Dummy_test,APL_CATEGORY = DUMMY)
 *结束

 *当APL_TIMES.MONTHNUM
 * IS 2
 * REC(表达式=(([[APL_TIMES]。[%Y%.04],[APL_CATEGORY]。[DUMMY],[APL_KEYFIGURE]。[Dummy_test])+([APL_TIMES .. [%Y%.05],[  APL_CATEGORY]。[DUMMY],[APL_KEYFIGURE。[AMT])),APL_TIMES =%Y%.05,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束

 *当APL_TIMES.MONTHNUM
 * IS 3
 * REC(EXPRESSION =([[APL_TIMES]。[%Y%.05],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%Y%.06],[APL_KEYFIGURE .. [AMT]),APL_TIMES =%  Y%.06,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束

 *当APL_TIMES.MONTHNUM
 * IS 4
 * REC(EXPRESSION =([[APL_TIMES]。[%Y%.06],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%Y%.07],[APL_KEYFIGURE .. [AMT]),APL_TIMES =%  Y%.07,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束
 *当APL_TIMES.MONTHNUM
 * IS 5
 * REC(EXPRESSION =([[APL_TIMES]。[%Y%.07],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%Y%.08],[APL_KEYFIGURE .. [AMT]),APL_TIMES =%  Y%.08,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束

 *当APL_TIMES.MONTHNUM
 * IS 6
 * REC(表达式=([[APL_TIMES]。[%Y%.08],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%Y%.09],[APL_KEYFIGURE .. [AMT]),APL_TIMES =%  Y%.09,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束
 *当APL_TIMES.MONTHNUM
 * IS 7
 * REC(EXPRESSION =([[APL_TIMES]。[%Y%.09],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%Y%.10],[APL_KEYFIGURE .. [AMT]),APL_TIMES =%  Y%.10,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束
 *当APL_TIMES.MONTHNUM
 * IS 8
 * REC(表达式=([[APL_TIMES]。[%Y%.10],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%Y%.11],[APL_KEYFIGURE。[AMT]),APL_TIMES =%  Y%.11,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束
 *当APL_TIMES.MONTHNUM
 * IS 9
 * REC(EXPRESSION =([[APL_TIMES]。[%Y%.11],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%Y%.12],[APL_KEYFIGURE]。[AMT]),APL_TIMES =%  Y%.12,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束

 *当APL_TIMES.MONTHNUM
 * IS 10

 * REC(表达式=([[APL_TIMES]。[%Y%.12],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%N%.01],[APL_KEYFIGURE .. [AMT]),APL_TIMES =%  N%.01,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束
 *当APL_TIMES.MONTHNUM
 * IS 11
 * REC(表达式=([[APL_TIMES]。[%N%.01],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%N%.02],[APL_KEYFIGURE .. [AMT]),APL_TIMES =%  N%.02,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束

 *当APL_TIMES.MONTHNUM
 * IS 12

 * REC(表达式=([[APL_TIMES]。[%N%.02],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%N%.03],[APL_KEYFIGURE .. [AMT]),APL_TIMES =%  N%.03,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束
 *结束
 

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


嗨,

我编写了一个BPC逻辑脚本来汇总下个月的上个月数据。 我有一个包可以执行此BPC逻辑脚本。 例如。 当我执行6月的数据包时,结果应为5月数据(即4月+ 5月)+ 6月数据。

进行汇总的数据保存在 Dummy_test 关键指标中。

AMT 键值具有原始 月数据。

在执行以下逻辑脚本时,例如 对于6月份,原来在6月份存在的记录将与5月份的数据相加。 因此May + June不会在6月添加May数据(A1 E2 100)的新条目。 而是显示如下单个记录

AMT的6月数据:

A1 E1 100

Dummy_test关键数据上的五月数据:

A1 E2 100

A1 E1 100

发布执行脚本:

Dummy_test Keyfigure上的6月数据:

A1 E1 200

预期输出:

Dummy_test Keyfigure上的6月数据:

A1 E1 200

A1 E2 100

我必须在下个月做一个简单的上个月加法。 请帮忙!

 * XDIM_MEMBERSET APL_TIMES =%APL_TIMES_SET%
 * XDIM_MEMBERSET APL_CATEGORY = DUMMY
 * XDIM_MEMBERSET APL_KEYFIGURE = AMT,虚拟测试
//* XDIM_MEMBERSET MEASURES = PERIODIC


 * SELECT(%Y%,YEAR,APL_TIMES,ID =%APL_TIMES_SET%)
 * SELECT(%1%,MONTHNUM,APL_TIMES,ID =%APL_TIMES_SET%)
 * SELECT(%N%,MONTHNUM,APL_TIMES,ID = TMVL(+ 1,%APL_TIMES_SET%))


 *当APL_CATEGORY
 *是假人
 *当APL_TIMES.MONTHNUM
 * IS 1
 * REC(EXPRESSION =%VALUE%,APL_TIMES =%Y%.04,APL_KEYFIGURE = Dummy_test,APL_CATEGORY = DUMMY)
 *结束

 *当APL_TIMES.MONTHNUM
 * IS 2
 * REC(表达式=(([[APL_TIMES]。[%Y%.04],[APL_CATEGORY]。[DUMMY],[APL_KEYFIGURE]。[Dummy_test])+([APL_TIMES .. [%Y%.05],[  APL_CATEGORY]。[DUMMY],[APL_KEYFIGURE。[AMT])),APL_TIMES =%Y%.05,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束

 *当APL_TIMES.MONTHNUM
 * IS 3
 * REC(EXPRESSION =([[APL_TIMES]。[%Y%.05],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%Y%.06],[APL_KEYFIGURE .. [AMT]),APL_TIMES =%  Y%.06,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束

 *当APL_TIMES.MONTHNUM
 * IS 4
 * REC(EXPRESSION =([[APL_TIMES]。[%Y%.06],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%Y%.07],[APL_KEYFIGURE .. [AMT]),APL_TIMES =%  Y%.07,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束
 *当APL_TIMES.MONTHNUM
 * IS 5
 * REC(EXPRESSION =([[APL_TIMES]。[%Y%.07],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%Y%.08],[APL_KEYFIGURE .. [AMT]),APL_TIMES =%  Y%.08,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束

 *当APL_TIMES.MONTHNUM
 * IS 6
 * REC(表达式=([[APL_TIMES]。[%Y%.08],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%Y%.09],[APL_KEYFIGURE .. [AMT]),APL_TIMES =%  Y%.09,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束
 *当APL_TIMES.MONTHNUM
 * IS 7
 * REC(EXPRESSION =([[APL_TIMES]。[%Y%.09],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%Y%.10],[APL_KEYFIGURE .. [AMT]),APL_TIMES =%  Y%.10,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束
 *当APL_TIMES.MONTHNUM
 * IS 8
 * REC(表达式=([[APL_TIMES]。[%Y%.10],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%Y%.11],[APL_KEYFIGURE。[AMT]),APL_TIMES =%  Y%.11,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束
 *当APL_TIMES.MONTHNUM
 * IS 9
 * REC(EXPRESSION =([[APL_TIMES]。[%Y%.11],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%Y%.12],[APL_KEYFIGURE]。[AMT]),APL_TIMES =%  Y%.12,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束

 *当APL_TIMES.MONTHNUM
 * IS 10

 * REC(表达式=([[APL_TIMES]。[%Y%.12],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%N%.01],[APL_KEYFIGURE .. [AMT]),APL_TIMES =%  N%.01,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束
 *当APL_TIMES.MONTHNUM
 * IS 11
 * REC(表达式=([[APL_TIMES]。[%N%.01],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%N%.02],[APL_KEYFIGURE .. [AMT]),APL_TIMES =%  N%.02,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束

 *当APL_TIMES.MONTHNUM
 * IS 12

 * REC(表达式=([[APL_TIMES]。[%N%.02],[APL_KEYFIGURE]。[Dummy_test] + [APL_TIMES]。[%N%.03],[APL_KEYFIGURE .. [AMT]),APL_TIMES =%  N%.03,APL_CATEGORY = DUMMY,APL_KEYFIGURE = Dummy_test)
 *结束
 *结束
 
付费偷看设置
发送
10条回答
95年老男孩
1楼 · 2020-08-30 04:32.采纳回答

用于更新所选月份以及所选月份之后所有月份的脚本:

 * SELECT(%Y%,YEAR,TIME,ID =%TIME_SET%)//%TIME_SET%-单个成员!
 * SELECT(%TID%,[TIMEID],TIME,ID =%TIME_SET%)

 * SELECT(%T01%,[ID],TIME,YEAR =%Y%AND TIMEID> =%TID%AND CALC = N)
 * SELECT(%TID02%,[TIMEID],TIME,YEAR =%Y%AND CALC = N AND MONTHNUM = 2)
 * SELECT(%T02%,[ID],TIME,TIMEID> =%TID02%AND ID =%T01%)
 * SELECT(%TID03%,[TIMEID],TIME,YEAR =%Y%AND CALC = N AND MONTHNUM = 3)
 * SELECT(%T03%,[ID],TIME,TIMEID> =%TID03%AND ID =%T01%)
 * SELECT(%TID04%,[TIMEID],TIME,YEAR =%Y%AND CALC = N AND MONTHNUM = 4)
 * SELECT(%T04%,[ID],TIME,TIMEID> =%TID04%AND ID =%T01%)
 * SELECT(%TID05%,[TIMEID],TIME,YEAR =%Y%AND CALC = N AND MONTHNUM = 5)
 * SELECT(%T05%,[ID],TIME,TIMEID> =%TID05%AND ID =%T01%)
 * SELECT(%TID06%,[TIMEID],TIME,YEAR =%Y%AND CALC = N AND MONTHNUM = 6)
 * SELECT(%T06%,[ID],TIME,TIMEID> =%TID06%AND ID =%T01%)
 * SELECT(%TID07%,[TIMEID],TIME,YEAR =%Y%AND CALC = N AND MONTHNUM = 7)
 * SELECT(%T07%,[ID],TIME,TIMEID> =%TID07%AND ID =%T01%)
 * SELECT(%TID08%,[TIMEID],TIME,YEAR =%Y%AND CALC = N AND MONTHNUM = 8)
 * SELECT(%T08%,[ID],TIME,TIMEID> =%TID08%AND ID =%T01%)
 * SELECT(%TID09%,[TIMEID],TIME,YEAR =%Y%AND CALC = N AND MONTHNUM = 9)
 * SELECT(%T09%,[ID],TIME,TIMEID> =%TID09%AND ID =%T01%)
 * SELECT(%TID10%,[TIMEID],TIME,YEAR =%Y%AND CALC = N AND MONTHNUM = 10)
 * SELECT(%T10%,[ID],TIME,TIMEID> =%TID10%AND ID =%T01%)
 * SELECT(%TID11%,[TIMEID],TIME,YEAR =%Y%AND CALC = N AND MONTHNUM = 11)
 * SELECT(%T11%,[ID],TIME,TIMEID> =%TID11%AND ID =%T01%)
 * SELECT(%TID12%,[TIMEID],TIME,YEAR =%Y%AND CALC = N AND MONTHNUM = 12)
 * SELECT(%T12%,[ID],TIME,TIMEID> =%TID12%AND ID =%T01%)

 *当TIME.MONTHNUM
 * IS 1
 *对于%M01%=%T01%
 * REC(EXPRESSION =%VALUE%,TIME =%M01%,ACCOUNT = BS111)
 *下一个
 * IS 2
 *对于%M02%=%T02%
 * REC(EXPRESSION =%VALUE%,TIME =%M02%,ACCOUNT = BS111)
 *下一个
 * IS 3
 *对于%M03%=%T03%
 * REC(EXPRESSION =%VALUE%,TIME =%M03%,ACCOUNT = BS111)
 *下一个
 * IS 4
 *对于%M04%=%T04%
 * REC(EXPRESSION =%VALUE%,TIME =%M04%,ACCOUNT = BS111)
 *下一个
 * IS 5
 *对于%M05%=%T05%
 * REC(EXPRESSION =%VALUE%,TIME =%M05%,ACCOUNT = BS111)
 *下一个
 * IS 6
 *对于%M06%=%T06%
 * REC(EXPRESSION =%VALUE%,TIME =%M06%,ACCOUNT = BS111)
 *下一个
 * IS 7
 *对于%M07%=%T07%
 * REC(EXPRESSION =%VALUE%,TIME =%M07%,ACCOUNT = BS111)
 *下一个
 * IS 8
 *对于%M08%=%T08%
 * REC(EXPRESSION =%VALUE%,TIME =%M08%,ACCOUNT = BS111)
 *下一个
 * IS 9
 *对于%M09%=%T09%
 * REC(EXPRESSION =%VALUE%,TIME =%M09%,ACCOUNT = BS111)
 *下一个
 * IS 10
 *对于%M10%=%T10%
 * REC(EXPRESSION =%VALUE%,TIME =%M10%,ACCOUNT = BS111)
 *下一个
 * IS 11
 *对于%M11%=%T11%
 * REC(EXPRESSION =%VALUE%,TIME =%M11%,ACCOUNT = BS111)
 *下一个
 * IS 12
 *对于%M12%=%T12%
 * REC(EXPRESSION =%VALUE%,TIME =%M12%,ACCOUNT = BS111)
 *下一个
 * ENDWHEN 
DafaDDDa
2楼-- · 2020-08-30 04:30

Neha Yadav

当然,最好是 删除数据是100%安全的! 您可以在同一脚本中将其删除。

场景将导致数据错误:

1。 您在PERIODIC中有一些价值

2。 您删除了该值

3。 您对模型执行了零消除精简优化。

消除零后,零记录将消失,脚本将不会重新计算YTD值...

如果您不使用精简优化 数据更改后消除零-那么一切都会正确的...

我是小鹏鹏啊
3楼-- · 2020-08-30 04:34

我已经阅读了此博客。 非常有帮助,但不适用于我的时间元素

我将2018.04作为1,然后将12作为2019.03 ..它为2019.01-2019.03提供了一些不匹配。 因此,我写了这个脚本

三十六小时_GS
4楼-- · 2020-08-30 04:25

好,所以例如。 我删除了6月的数据,现在我更改了PRD中的一些数据,这些数据将以YTD格式在此处获取。

所以我需要对代码进行哪些更改,以便仅在受影响的六月和几个月后发布,而不会在四月和五月发布

一周热门 更多>