on 12-27-2017 7:04 AM
Hi expert,
I use "For...Next" function in case of divested entity in logic script and identify 3 variables in script which is retrieved from entity property dimension. Set of data that is used in script came from Entity Dimension as table below:
and the below is script
I expect that script should be run each set of data separately but in fact script will be sorted each property first then run script so the data that I get, it will show as below:
You can find that Entity B is disposed in year 2017 in first table but when I check the result, it is work like disposed in year 2015 while Entity D should be disposed in year 2015 but it work like disposed in year 2017.
My question is:
1.) Can I use For...Next function in this case? If not, can I use any function, please recommend me, I will be appreciated too much.
2.) If yes in the first question, please correct me that should I revise script or add something else for making script work correctly
Thanks in advance for your help and Happy New Year everyone.
Bam
Just performed simple test in UJKT with ENVIRONMENTSHELL copy:
ENTITY dimension:
Script:
*SELECT(%ENS%,[ID],ENTITY,[DISPOSAL]=Y)
*XDIM_MEMBERSET ENTITY=%ENS%
*SELECT(%TIDS%,[DATE_CHANGE],ENTITY,[DISPOSAL]=Y)
*SELECT(%YS%,[YEAR_CHANGE],ENTITY,[DISPOSAL]=Y)
*FOR %EN%=%ENS% AND %TID%=%TIDS% AND %Y%=%YS%
*XDIM_MEMBERSET ENTITY=%EN%
*XDIM_FILTER TIME = [TIME].properties("TIMEID") = "%TID%"
*XDIM_FILTER TIME = [TIME].properties("YEAR") = "%Y%"
*NEXT
UJKT result:
LGX:
*XDIM_MEMBERSET ENTITY=BR,CA,DE,FR
*XDIM_MEMBERSET ENTITY=BR
*XDIM_FILTER TIME = [TIME].properties("TIMEID") = "20140800"
*XDIM_FILTER TIME = [TIME].properties("YEAR") = "2014"
*XDIM_MEMBERSET ENTITY=CA
*XDIM_FILTER TIME = [TIME].properties("TIMEID") = "20151200"
*XDIM_FILTER TIME = [TIME].properties("YEAR") = "2015"
*XDIM_MEMBERSET ENTITY=DE
*XDIM_FILTER TIME = [TIME].properties("TIMEID") = "20161000"
*XDIM_FILTER TIME = [TIME].properties("YEAR") = "2016"
*XDIM_MEMBERSET ENTITY=FR
*XDIM_FILTER TIME = [TIME].properties("TIMEID") = "20171000"
*XDIM_FILTER TIME = [TIME].properties("YEAR") = "2017"
Looks correct!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Happy New Year Vadim,
Thanks a lot for your answer...First I will try to revise my script as your suggestion and let you know about the result.
Bam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My sample script demonstrates a correct order of id’s and properties in for/next loop.
Please provide a full script, and post it as a text, not as picture. I don't see definition of variables.
Also please explain the required calculation logic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
16 | |
3 | |
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.