on 2012 May 09 12:33 PM
Hello BPC Experts,
We are trying to execute the following allocation.
When we do the validate and save for the logic we get the following error:
Validation status of executable file: Failed - Invalid column name 'AUX_VRI'. in:select [ID] from mbrPRODUCTO where [REPARTOFIN]=AUX_VRI
In the dimension we have a member whit ID AUX_VRI.
It seems that there is problem in the where part when we pass a variable. It is possible to pass a variable to get the name of the property??
*RUNALLOCATION
*DIM PRODUCTO WHAT=%AUX_REPARTO%; WHERE=[REPARTOFIN]=%AUX_REPARTO%;
*ENDALLOCATION
*COMMIT
The idea that we have in mind is to copy the values that are stored in a member whose value is stored in the variable %AUX_REPARTO% into all the members that have the same value in the property [REPARTOFIN].
For instance we have the value 5 in the member ID PRODUCTA and we want to copy this value in the members PRODUCT1, PRODUCT2 and PRODUCT3 that have the following value for the property [REPARTOFIN]=PRODUCTA .
Is there any other workaround to do that??
Thanks in advance
Hi Lauro,
try using a select statement
*SELECT(%Prods%,"ID","PRODUCTO","REPARTOFIN = %AUX_REPARTO%") and a FOR/NEXT statement with the %Prods% around the runallocation.
Kind regards
Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Roberto,
I have tryed your idea but the variables are still not working properly with your solution.
As I am not working with too many items I have hardcoded the possible combinations avoiding the use of vairables in the second part of the ALLOCATION.
It is not the most elegant solution but it is working for the moment.
Best regards
Hello Roberto,
We have the following situation:
Dimension PRODUCTO
ID REPARTOFIN
Product1 AUX_REPARTO
Product1a Product1
Product1b Product1
Product1c Product1
Product2 AUX_REPARTO
Product2a Product2
Prodcut2b Product2
We want to copy the values in Product1 in Product1a, Product1b and Product1c. And the same for Product2 in Product2a and Product2b. We had the following idea, but the variable in the where part of the allocation is not working properly and give us a compilation error
*SELECT(%AUX_REPARTO%,"[ID]",PRODUCTO,"[REPARTOFIN]='AUX_REPARTO'")
*XDIM_MEMBERSET PRODUCTO=%AUX_REPARTO%
*RUNALLOCATION
*DIM PRODUCTO WHAT=%AUX_REPARTO%; WHERE=[REPARTOFIN]=%AUX_REPARTO%;
*ENDALLOCATION
*COMMIT
*XDIM_MEMBERSET PRODUCTO=AUX_PIAS
*RUNALLOCATION
*DIM PRODUCTO WHAT=AUX_PIAS; WHERE=[REPARTOFIN]='AUX_PIAS';
*ENDALLOCATION
*COMMIT
Is there any possible workaround?
Thanks
Hi Lauro,
try this
*SELECT(%AUX_REPARTO%,"ID","PRODUCTO","REPARTOFIN='AUX_REPARTO'")
*XDIM_MEMBERSET PRODUCTO=%AUX_REPARTO%
*FOR %REPARTO%=%AUX_REPARTO%
*RUNALLOCATION
*DIM PRODUCTO WHAT='%REPARTO%'; WHERE=[REPARTOFIN]='%REPARTO%';
*ENDALLOCATION
*NEXT
*COMMIT
Sorry but I don't understand the second parte of your script
*XDIM_MEMBERSET PRODUCTO=AUX_PIAS
*RUNALLOCATION
*DIM PRODUCTO WHAT=AUX_PIAS; WHERE=[REPARTOFIN]='AUX_PIAS';
*ENDALLOCATION
*COMMIT
if you want just change automatically the value of REPARTOFIN you can use a PROMPT asking for this value, or passing it as parameter when you call your script from another script (then you must refers to it as %P1% inside the script).
Consequently you must change the SELECT statement substituting the fixed value with the corresponding variable.
Kind regards
Roberto
Hi Roberto,
Thanks again for your answer.
When we try to validate & save we get the following error:
Validation status of executable file: Failed - Incorrect syntax near 'AUX_VRI'. in:Select ISBASEMEM From mbrPRODUCTO where [id]=''Product1''
It seems that the system it is not able to solve the value of the where part of the allocation.
*FOR %REPARTO%=%AUX_REPARTO%
*RUNALLOCATION *DIM PRODUCTO WHAT='%REPARTO%'; WHERE=[REPARTOFIN]='%REPARTO%';
*ENDALLOCATION *NEXT
The second part of the script shows how we have made it work by hardcoding the values. It has no other meaning.
Best regards
User | Count |
---|---|
14 | |
4 | |
2 | |
2 | |
2 | |
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.