We're using BPC 10.1 SP2 for NW and seeing odd behavior with BPC Script. I've taken my actual more complicated script and stripped it down to a very simple form to confirm that the values are still tripled. Note that the value is tripled on the first run. Subsequent runs do NOT increase the value.
I have found a work-around by using a FOR loop, but this changed the run time from my script from 55 seconds to 18 minutes. My code will eventually reside within a package and in Default logic, so 18 minutes is unacceptable. I have hard-coded a few of the members for test purposes. Any suggestions as to what might be happening?
Test Results:
1. Multiple embedded WHEN statements did not change the behavior
2. Omitting the MEASURES scoping did not change the behavior
3. Limiting scope to a single ENTITY produced correct results but this is not a viable option
Code that triples:
*SELECT(%PROFIT_CENTERS%, "[ID]", "ENTITY", "[INTCO]<>''")
*XDIM_MEMBERSET ACCOUNT = 701003
*XDIM_MEMBERSET AUDIT_ID = ALLOCATION_ENTRY
*XDIM_MEMBERSET CURRENCY = LC
*XDIM_MEMBERSET ENTITY = %PROFIT_CENTERS%
*XDIM_MEMBERSET FLOW = F_CLO
*XDIM_MEMBERSET INTERCO = I_1000
*XDIM_MEMBERSET SCOPE = S_NONE
*XDIM_MEMBERSET TIME = 2012.03
*XDIM_MEMBERSET VERSION = PLAN
*XDIM_MEMBERSET MEASURES = YTD
*WHEN CURRENCY
*IS LC
*REC(EXPRESSION=(%VALUE%),VERSION="ACTUAL",AUDIT_ID="ALLOC_CALC_MGMT")
*ENDWHEN
Code that works but takes too long:
*SELECT(%PROFIT_CENTERS%, "[ID]", "ENTITY", "[INTCO]<>''")
*XDIM_MEMBERSET ACCOUNT = 701003
*XDIM_MEMBERSET AUDIT_ID = ALLOCATION_ENTRY
*XDIM_MEMBERSET CURRENCY = LC
*XDIM_MEMBERSET ENTITY = %PROFIT_CENTERS%
*XDIM_MEMBERSET FLOW = F_CLO
*XDIM_MEMBERSET INTERCO = I_1000
*XDIM_MEMBERSET SCOPE = S_NONE
*XDIM_MEMBERSET TIME = 2013.03
*XDIM_MEMBERSET VERSION = PLAN
*XDIM_MEMBERSET MEASURES = YTD
*FOR %CENTER% = %PROFIT_CENTERS%
*WHEN ENTITY
*IS %CENTER%
*REC(EXPRESSION=(%VALUE%),VERSION="ACTUAL",AUDIT_ID="ALLOC_CALC_MGMT")
*ENDWHEN
*NEXT