Skip to Content
0
Former Member
Sep 19, 2014 at 01:51 PM

BPC 7.5 Script Logic - If / Then logic

48 Views

Hi

We are currently on BPC 7.5 NW and are trying to update some of script logic be be a bit more dynamic. During a couple of weeks a year we need to run some script logic in a script. We were hoping to be able to alter the code so that if we set some variable, or put a value in a dimension then it would run a couple of lines of code. Has anyone ever tried to do this?

Idea would be something like:

//*******************Create variables************************

//select the time filters

*SELECT (%CUR_PERIOD%, "[ID]", "TIME", "CURRENT_YEAR='C'")

*SELECT (%FURTURE_PERIOD%, "[ID]", "TIME", "CURRENT_YEAR='F'")

//pull actual current version

*SELECT(%CURR_VERSION%, "ACTUAL_VERSION", "VERSIONBASE", "[ID]='ACTUAL'")

//CMRAW - only select CSL relevant materials

*SELECT(%CSL_REL%, "[ID]", CMRAW, "[CSL_RELEVANT]='N' AND [RPTRAW]<>''")

//ensure that you are selecting only those that have a a profit group / GPH assigned to them

*SELECT(%FINSC%, "[ID]", FIN, "[RPTFIN_ID]<>'' AND [RPTFIN]<>''")

//this is needed since during VOL_refresh and SP you have a statement that needs to grab both Y and N

*SELECT(%CSL_REL_ALL%, "[ID]", CMRAW, "[RPTRAW]<>''")

*SELECT(%SPRING_PLAN%, "SPRING_PLANT", CMRAW, "[ID]="SPRING_PLAN'")

//************************************************************

 

//*************************

//Intmktcovspend CURRMMO

//*************************

IF %SPRING_PLAN% = "YES" THEN

*XDIM_MEMBERSET CMRAW= %CSL_REL%

*XDIM_MEMBERSET CURRENCY=USD

*XDIM_MEMBERSET CMACCT=A_INTMKTCOVSPND

*XDIM_MEMBERSET CMDATASRC=DS_INPUT

*XDIM_MEMBERSET VERSIONBASE=CURRMMO

*XDIM_MEMBERSET TIME= %CUR_PERIOD%,%FURTURE_PERIOD%

*XDIM_MEMBERSET FIN=%FINSC%

*XDIM_MAXMEMBERS TIME=1

 

*DESTINATION_APP = REPORTING

*ADD_DIM DATASRCRPT=DS_CMFEED, VERSIONCOMP=VCNONE, ACCTRPT=A_INTMKTCOVSPND

*RENAME_DIM CMACCT=PROFIT_HIER, FIN=FINRPT, CMDATASRC=RAW_OWNER

*WHEN FIN

*IS *

*REC(EXPRESSION=%VALUE%,CMACCT=FIN.RPTFIN_ID,CMDATASRC=CMRAW.RPTRAW,FIN=FIN.RPTFIN)

*ENDWHEN

END IF