BLINOVDANIIL_Расчет нарастающего итого без хаккода(ytd из per)
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

BLINOVDANIIL_Расчет нарастающего итого без хаккода(ytd из per)

  • 258 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
258
On Slideshare
257
From Embeds
1
Number of Embeds
1

Actions

Shares
Downloads
3
Comments
0
Likes
0

Embeds 1

https://www.linkedin.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. BLINOVDANIIL.COM____________________________________________________________________ bdaniil@gmail.com Меппинг. Перевод из периодического в нарастающий итог (YTD ) Пример скрипт логики (ZTEST_MMV007_MAP_YTD.LGF): //Временный расчет нарастающего итога для данных Бюджетирования //Сопоставление периодов для года. *SELECT (%ENTITY_SEL%, ID, ENTITY, [DIMLIST] = S1) // все движения *SELECT (%ACCT1%, ID, ACCOUNT, [DIMLIST] = BS) //сальдо на конец нарастающим итогом *SELECT (%ACCT2%, ID, ACCOUNT, [DIMLIST] = PL) //сальдо на конец нарастающим итогом *SELECT (%ACCT3%, ID, ACCOUNT, [DIMLIST] = CF) //сальдо на конец нарастающим итогом *SELECT (%ACCT4%, ID, ACCOUNT, [DIMLIST] = ZL) //сальдо на начало *SELECT (%ACCT5%, ID, ACCOUNT, [DIMLIST] = ZX) //сальдо на конец *SELECT (%ACCT6%, ID, ACCOUNT, [DIMLIST] = ZY) // все движения *SELECT (%ACCT7%, ID, ACCOUNT, [DIMLIST] = ZC) //Переменная $ZYEAR$ приходит из пакета диспетчера данных *SELECT (%Q1%, ID, TIME, [YEAR] = $ZYEAR$ AND [PERIOD] = MAR) *SELECT (%Q2%, ID, TIME, [YEAR] = $ZYEAR$ AND [PERIOD] = JUN) *SELECT (%Q3%, ID, TIME, [YEAR] = $ZYEAR$ AND [PERIOD] = SEP) *SELECT (%Q4%, ID, TIME, [YEAR] = $ZYEAR$ AND [PERIOD] = DEC) //Во избежание задвоения данных очищаем срез по источнику данных "DLI00" перед началом расчета //-------------------------------------------------------------------------- *XDIM_MEMBERSET CATEGORY = %CATEGORY_SET% *XDIM_MEMBERSET CURRENCYTYPE = BAS(C00) *XDIM_ADDMEMBERSET CURRENCYTYPE = C_NONE *XDIM_MEMBERSET C_CURRENCY = LC *XDIM_MEMBERSET C_GROUP = G_NONE *XDIM_MEMBERSET ELCOST = L_NONE *XDIM_MEMBERSET ENTITY = %ENTITY_SEL% *XDIM_ADDMEMBERSET ENTITY = E1000000000 *XDIM_MEMBERSET FLOW = BAS(F00000) *XDIM_ADDMEMBERSET FLOW = F33020,F43020,F00998,F00999 *XDIM_MEMBERSET INTERCO = BAS(I0000000000) *XDIM_MEMBERSET PAUDITID = DLI00 *XDIM_MEMBERSET SEGMENT = S_NONE *XDIM_MEMBERSET TIME = %Q1%,%Q2%,%Q3%,%Q4% *WHEN ACCOUNT.CALC *IS N *REC(EXPRESSION = 0) *ENDWHEN *COMMIT //Расчет нарастающего итога для групп счетов: BS, ZC //-------------------------------------------------------------------------- *XDIM_MEMBERSET ACCOUNT = %ACCT1%,%ACCT7% *XDIM_MEMBERSET CATEGORY = %CATEGORY_SET% *XDIM_MEMBERSET CURRENCYTYPE = BAS(C00) *XDIM_ADDMEMBERSET CURRENCYTYPE = C_NONE *XDIM_MEMBERSET C_CURRENCY = LC *XDIM_MEMBERSET C_GROUP = G_NONE *XDIM_MEMBERSET ELCOST = L_NONE *XDIM_MEMBERSET ENTITY = %ENTITY_SEL% *XDIM_ADDMEMBERSET ENTITY = E1000000000 *XDIM_MEMBERSET FLOW = BAS(F00000) *XDIM_ADDMEMBERSET FLOW = F33020,F43020,F00998,F00999 *XDIM_MEMBERSET INTERCO = BAS(I0000000000) *XDIM_MEMBERSET PAUDITID = DDL //Загруженные из BI данные до преобразований *XDIM_MEMBERSET SEGMENT = S_NONE *XDIM_MEMBERSET TIME = %Q1%,%Q2%,%Q3%,%Q4% *WHEN FLOW *IS F00001 //Начальное сальдо переносим только в первом периоде *WHEN TIME
  • 2. BLINOVDANIIL.COM____________________________________________________________________ bdaniil@gmail.com *IS %Q1% *REC(TIME = %Q4%,PAUDITID = DLI00) *ENDWHEN *IS F00999 //Конечное сальдо переносим только в последнем периоде *WHEN TIME *IS %Q4% *REC(TIME = %Q4%,PAUDITID = DLI00) *ENDWHEN *ELSE //Обороты переносятся во всех периодах *REC(TIME = %Q4%,PAUDITID = DLI00) *ENDWHEN //Расчет нарастающего итога для груп счетов: PL,CF,ZL //-------------------------------------------------------------------------- *XDIM_MEMBERSET ACCOUNT = %ACCT2%,%ACCT3%,%ACCT4% *XDIM_MEMBERSET CATEGORY = %CATEGORY_SET% *XDIM_MEMBERSET CURRENCYTYPE = BAS(C00) *XDIM_ADDMEMBERSET CURRENCYTYPE = C_NONE *XDIM_MEMBERSET C_CURRENCY = LC *XDIM_MEMBERSET C_GROUP = G_NONE *XDIM_MEMBERSET ELCOST = L_NONE *XDIM_MEMBERSET ENTITY = %ENTITY_SEL% *XDIM_ADDMEMBERSET ENTITY = E1000000000 *XDIM_MEMBERSET FLOW = F00999 //Конечное сальдо *XDIM_MEMBERSET INTERCO = BAS(I0000000000) *XDIM_MEMBERSET PAUDITID = DDL //Загруженные из BI данные до преобразований *XDIM_MEMBERSET SEGMENT = S_NONE *XDIM_MEMBERSET TIME = %Q1%,%Q2%,%Q3%,%Q4% *WHEN TIME *IS * *REC(TIME = %Q4%,PAUDITID = DLI00) *ENDWHEN //Расчет нарастающего итога для группы счетов: ZX //-------------------------------------------------------------------------- *XDIM_MEMBERSET ACCOUNT = %ACCT5% *XDIM_MEMBERSET CATEGORY = %CATEGORY_SET% *XDIM_MEMBERSET CURRENCYTYPE = BAS(C00) *XDIM_ADDMEMBERSET CURRENCYTYPE = C_NONE *XDIM_MEMBERSET C_CURRENCY = LC *XDIM_MEMBERSET C_GROUP = G_NONE *XDIM_MEMBERSET ELCOST = L_NONE *XDIM_MEMBERSET ENTITY = %ENTITY_SEL% *XDIM_ADDMEMBERSET ENTITY = E1000000000 *XDIM_MEMBERSET FLOW = F00999,F00996 //Конечное сальдо и объем *XDIM_MEMBERSET INTERCO = BAS(I0000000000) *XDIM_MEMBERSET PAUDITID = DDL //Загруженные из BI данные до преобразований *XDIM_MEMBERSET SEGMENT = S_NONE *XDIM_MEMBERSET TIME = %Q1% //Первый период *WHEN TIME *IS * *REC(TIME = %Q4%,PAUDITID = DLI00) *ENDWHEN //Расчет нарастающего итога для группы счетов: ZY //-------------------------------------------------------------------------- *XDIM_MEMBERSET ACCOUNT = %ACCT6% *XDIM_MEMBERSET CATEGORY = %CATEGORY_SET% *XDIM_MEMBERSET CURRENCYTYPE = BAS(C00) *XDIM_ADDMEMBERSET CURRENCYTYPE = C_NONE *XDIM_MEMBERSET C_CURRENCY = LC *XDIM_MEMBERSET C_GROUP = G_NONE *XDIM_MEMBERSET ELCOST = L_NONE *XDIM_MEMBERSET ENTITY = %ENTITY_SEL% *XDIM_ADDMEMBERSET ENTITY = E1000000000 *XDIM_MEMBERSET FLOW = F00999,F00996 //Конечное сальдо и объем *XDIM_MEMBERSET INTERCO = BAS(I0000000000) *XDIM_MEMBERSET PAUDITID = DDL //Загруженные из BI данные до преобразований *XDIM_MEMBERSET SEGMENT = S_NONE *XDIM_MEMBERSET TIME = %Q4% //Последний период *WHEN TIME *IS *
  • 3. BLINOVDANIIL.COM____________________________________________________________________ bdaniil@gmail.com *REC(PAUDITID = DLI00) *ENDWHEN Пакет из Диспетчера данных PROMPT(SELECTINPUT,,,,"%CATEGORY_DIM%") PROMPT(TEXT, %ZYEAR%, "Введите год, данные за который необходимо трансформировать:", [PWD], "2013,2014,2015,2016,2017,2018,2019,2020") INFO(%EQU%,=) TASK(/CPMB/RUNCALCACCOUNT_LOGIC,SUSER,%USER%) TASK(/CPMB/RUNCALCACCOUNT_LOGIC,SAPPSET,%APPSET%) TASK(/CPMB/RUNCALCACCOUNT_LOGIC,SAPP,%APP%) TASK(/CPMB/RUNCALCACCOUNT_LOGIC,SELECTION,%SELECTION%) TASK(/CPMB/RUNCALCACCOUNT_LOGIC,LOGICFILENAME,ZTEST_MMV007_MAP_YTD.LGF) TASK(/CPMB/RUNCALCACCOUNT_LOGIC,REPLACEPARAM,ZYEAR%EQU%%ZYEAR%)