on 02-12-2016 12:35 PM
Hi
I have an input schedule and when I saved the data, I need to derive values (year month) to another dimension (Year) (which will be used for annual planning).
BPC 10.0
input schedule 1:
Year 0001 0001 0001 0001
Product Time 2017.01, 2017.02, 2017.03 .... 2018.01, 2018.02
B
C
D
My default.lgf:
* XDIM_MEMBERSET TIME =% TIME_SET%
* XDIM_MEMBERSET YEAR =% YEAR_SET%
* WHEN YEAR
* IS "0001"
* FOR% TP =%%% TIME_SET
* SELECT (% YEAR2%, [YEAR], TIME, ID =% TP%)
* REC (EXPRESSION =% VALUE% YEAR =% YEAR2%)
* NEXT
* ENDWHEN
* COMMIT
ERROR
Error executing logical proposal ()
Memb. "" Does not exist
I want to replace the value in the year 0001 for the "year.month" inserted.
note: input schedule has one or more periods .example from 2017.01 to 2019.01
Thanks and Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vadim
Sorry, it happened when i have copied and pasted.
Okay, I understand your comments. Did you understand my question?
- "Select" command: I need to increment the "year month" to get the corresponding attribute value (year).
- Ex. The user insert value to 2017.01 i need to get 2017... insert value 2018.04 i get 2018 and insert into dimension "year"
* Using "SELECT" inside "FOR/*NEXT" and TMVL(1,%TIME_SET%), it is working fine "when inserted 2 month" ..example: 2017.01 and 2018.04 but when i have more one month,the script is not working.
*XDIM_MEMBERSET YEAR = %YEAR_SET%
*FOR %TP%=%TIME_SET%
*SELECT(%YEAR2%,[YEAR],TIME,ID = TMVL(1,%TIME_SET%))
*WHEN YEAR
*IS "0001"
*REC(EXPRESSION = %VALUE%,YEAR=%YEAR2%)
*ENDWHEN
*NEXT
*COMMIT
Thanks.
Using *SELECT inside *FOR/*NEXT loop is possible, but only if variable name is changing. Since you have fixed variable name (not dependent of FOR/NEXT variable) you'll get error about multiple definitions of same variable.
I still can't understand what you are trying to achieve, but it looks like if you just have YEAR = TIME.YEAR in your REC statement then you don't need those SELECT statements.
Hi Gersh,
As far as I remember SELECT is simply processed before FOR/NEXT processing!
I have tested the simple script with changing variable name and it's not working:
*SELECT(%TIDS%,[TIMEID],TIME,[ID]=%TIME_SET%)
*SELECT(%TS%,[ID],TIME,[ID]=%TIME_SET%)
*FOR %TID%=%TIDS% AND %T%=%TS%
*SELECT(%Y_%TID%%,[YEAR],TIME,[ID]=%T%)
*XDIM_MEMBERSET TIME=%Y_%TID%%.01
*NEXT
Vadim
Hi Vadim,
No, SELECT and FOR/NEXT are processed in same parsing phase. This was working in BPC NW 7.0, but if you have OSS Note 2195744 implemented it seems having a bug. I'll try contacting developer to fix it.
Also, I used %Y_%%TID% rather than %Y_%TID%% because then it didn't depend in what order variables are substituted.
Sorry for misleading advice.
Gersh
P.S. Checked again. What was working is SELECT inside a nested FOR/NEXT loop, but now value of %% variables are not substituted until *NEXT is reached, but Master Data in SELECT is retrieved as soon as that SELECT is processed. So, yes, SELECT is processed before FOR/NEXT.
Hi Gersh,
I do not understand the logic of %Y_%%TID%...
But I tested it (copy of the environmentshell) CPMBPC 800 SP 14 without OSS Note 2195744:
TIME=2014.01,2015.02,2015.04
*SELECT(%TIDS%,[TIMEID],TIME,[ID]=%TIME_SET%)
*SELECT(%TS%,[ID],TIME,[ID]=%TIME_SET%)
*FOR %TID%=%TIDS% AND %T%=%TS%
*SELECT(%Y_%%TID%,[YEAR],TIME,[ID]=%T%)
*XDIM_MEMBERSET TIME=%Y_%%TID%.01
*NEXT
Same result (after Execute):
LGX:
*XDIM_MEMBERSET TIME=%Y_%%TIDS%.01
-------------------------------------------------------------------------------------------------------------------------------------
LOG:
FILE:\ROOT\WEBFOLDERS\ENV1 \ADMINAPP\PERIODPLAN\TEST.LGF
USER:V.KALININ
APPSET:ENV1
APPLICATION:PERIODPLAN
UJK_VALIDATION_EXCEPTION:Member ".01" not exist
Vadim
User | Count |
---|---|
15 | |
4 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.