on ‎2016 Feb 04 8:30 AM
Hello Gurus,
My entity dimension looks like this
| Entity | Location (property) |
|---|---|
| G_IE01 | IE01 |
| G_IE02 | IE02 |
| G_IE03 | IE03 |
I have a *FOR loop that goes through each Entity AND Location, Location property is saved in a variable such as
*SELECT(%LOC%,LOCATION,ENTITY,"[ID]=%ENTITY_SET")
and the loop goes like this
*FOR %ENTITY%=%ENTITY_SET% AND %LOCATIONS%=%LOC%
....
*NEXT
If the user executes the package for G_IE01, G_IE02 and G_IE03 everything's fine. Each Entity & location set is assigned fine, but if the user changes the order :
G_IE03, G_IE02,G_IE01
Then wrong locations are assigned,
G_IE03 -> IE01
G_IE02 -> IE02
G_IE01 -> IE03
I guess that %LOC% variable is ordered by the natural order in the dimension but... is there any workaround for this? Such as ordering %LOCATION_SET% ?
Thanks ahead
/laura
Request clarification before answering.
Hi Laura,
Easy:
*SELECT(%ENT%,ID,ENTITY,"[ID]=%ENTITY_SET") //Sorted correctly!
*SELECT(%LOC%,LOCATION,ENTITY,"[ID]=%ENT%")
*FOR ...
Vadim
P.S. *FOR %ENTITY%=%ENT% AND %LOCATIONS%=%LOC%
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sample in UJKT:
Data Region:
TITLES=3100,1110,4100
Correct order is 1110,3100,4100!
Script:
*SELECT(%TS%,[ID],TITLES,[ID]=%TITLES_SET%)
*SELECT(%BS%,[PLANBE],TITLES,[ID]=%TITLES_SET%)
*SELECT(%BS1%,[PLANBE],TITLES,[ID]=%TS%)
//Incorrect
*FOR %T%=%TITLES_SET% AND %B%=%BS%
*XDIM_MEMBERSET TITLES=%T%
*XDIM_MEMBERSET BE=%B%
*NEXT
//Correct
*FOR %T1%=%TS% AND %B1%=%BS1%
*XDIM_MEMBERSET TITLES=%T1%
*XDIM_MEMBERSET BE=%B1%
*NEXT
Result:
LGX:
(Incorrect)
*XDIM_MEMBERSET TITLES=3100
*XDIM_MEMBERSET BE=BE1000
*XDIM_MEMBERSET TITLES=1110
*XDIM_MEMBERSET BE=BE3000
*XDIM_MEMBERSET TITLES=4100
*XDIM_MEMBERSET BE=BE4000
(Correct)
*XDIM_MEMBERSET TITLES=1110
*XDIM_MEMBERSET BE=BE1000
*XDIM_MEMBERSET TITLES=3100
*XDIM_MEMBERSET BE=BE3000
*XDIM_MEMBERSET TITLES=4100
*XDIM_MEMBERSET BE=BE4000
Vadim
| User | Count |
|---|---|
| 18 | |
| 11 | |
| 9 | |
| 3 | |
| 2 | |
| 2 | |
| 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.