Script Logic: Changes in FACTOR ignored

Hi colleagues,
I'm running a basic allocation (BPC 7.5 MS):
*RUNALLOCATION
*FACTOR=USING/TOTAL
*DIM P_ACCT WHAT=5301010130; WHERE=5301010130; USING=5301010130; TOTAL=5301010130
*DIM P_RE WHAT=160371292;WHERE=[LAND]='UK' AND [DIVISION]='Land' AND [ID]<>'160371292' AND [ID]<>'UK__LAND'; USING=<<<; TOTAL=UK__LAND
*DIM TIME WHAT=2011.JAN; WHERE=2011.JAN; USING=2010.JAN; TOTAL=2010.JAN
*ENDALLOCATION
The trouble is that when calculating the allocation FACTOR is always set to USING. I have the following values for JAN.2010:
P_RE:   Value for USING
A   =      2
B   =     3
C   =      5
The value to allocate (WHAT) is 100. Whatever I write as FACTOR (USING, USING/TOTAL, 10000, or even USING/0 which should generate an error) gives me the WHERE values for JAN.2011:
P_RE:   Value for WHERE
A    =     200
B     =    300
C     =    500
Thus the engine always multiplies WHAT with USING for each P_RE.
When debugging, WHAT is calculated correctly, but the beginning of the log reads:
Executing allocation @A_1 -
FACTOR = USING
APP/DIM      WHAT         WHERE                                                     USING        TOTAL
P_ACCT  -->  5301010130   5301010130                                                5301010130
P_RE    -->  160371292    [LAND]='UK' AND [DIVISION]='LAND' AND [ID]<>'160371292'   <<<
TIME    -->  2011.JAN     2011.JAN                                                  2010.JAN
-->
As you see, FACTOR is set to USING and I don't see the TOTAL value anywhere in the table.
Any light to be thrown???
Cheers,
Cecilia

Hi colleagues,
I'm running a basic allocation (BPC 7.5 MS):
*RUNALLOCATION
*FACTOR=USING/TOTAL
*DIM P_ACCT WHAT=5301010130; WHERE=5301010130; USING=5301010130; TOTAL=5301010130
*DIM P_RE WHAT=160371292;WHERE=[LAND]='UK' AND [DIVISION]='Land' AND [ID]<>'160371292' AND [ID]<>'UK__LAND'; USING=<<<; TOTAL=UK__LAND
*DIM TIME WHAT=2011.JAN; WHERE=2011.JAN; USING=2010.JAN; TOTAL=2010.JAN
*ENDALLOCATION
The trouble is that when calculating the allocation FACTOR is always set to USING. I have the following values for JAN.2010:
P_RE:   Value for USING
A   =      2
B   =     3
C   =      5
The value to allocate (WHAT) is 100. Whatever I write as FACTOR (USING, USING/TOTAL, 10000, or even USING/0 which should generate an error) gives me the WHERE values for JAN.2011:
P_RE:   Value for WHERE
A    =     200
B     =    300
C     =    500
Thus the engine always multiplies WHAT with USING for each P_RE.
When debugging, WHAT is calculated correctly, but the beginning of the log reads:
Executing allocation @A_1 -
FACTOR = USING
APP/DIM      WHAT         WHERE                                                     USING        TOTAL
P_ACCT  -->  5301010130   5301010130                                                5301010130
P_RE    -->  160371292    [LAND]='UK' AND [DIVISION]='LAND' AND [ID]<>'160371292'   <<<
TIME    -->  2011.JAN     2011.JAN                                                  2010.JAN
-->
As you see, FACTOR is set to USING and I don't see the TOTAL value anywhere in the table.
Any light to be thrown???
Cheers,
Cecilia

Similar Messages

  • Copying the data and ignoring the Script logic

    Hi,
    I have some data in Actual category for 2010.APR and I would like to COPY the same
    (through DM) to Budget category with my default script logic file.  When I am trying to
    Do the same it is copying the same data into Budget category, ignoring my script logic
    Actually it should increase the value.
    Can anybody help me in this regard.
    Thanks in adv.
    Raghu B.S.

    The problem it is into script logic.
    When you insert records you are inserting records with category Budget.
    But your default script logic is inserting new recotrds just in case if the input has category Actual.
    So you just to do a correction into your script logic to change the statement
    *WHEN CATEGORY
    *IS "ACTUAL"
    with
    *WHEN CATEGORY
    *IS "BUDGET"
    In this way the default script logic will be executed and after the copy you will have also the records generated by script logic.
    Regards
    Sorin Radulescu
    Edited by: Sorin Radulescu on Aug 5, 2010 2:15 PM

  • Changing Work Status using data package or script logic

    Is it possible to set Work Status using Script logic, or an SSIS package.
    I know status is kept is an SQL table, is it possible to just update the locking table with a new record, or is there more to changing the work status.
    Thanks for you help

    Thanks for your reply. This would be a nice enhancement.
    Although the work status does help with the audit trail of who and what locks the data, doing it automatically will allow the system to automatically unlock the period when it is opened before auto-loading the current closing balances. It will need to be carefully used in order to maintain proper audit trail of the data. When done automatically, the system userid would be used in the lock table witha  timestamp.
    I am needing to know if there are anyother steps involved in locking data other than writing to the SQL lock table. Is usppose this is especailly relevant when locking a parent and pushing the status to the children.

  • Having issue using TMVL in script logic

    Hello experts,
    We need to replicate the behaviour of the copy opening Bal through script logic.
    Below is my code:
    where user selects only entity when he runs package,time is derived from property.
    // Year from version property
    *SELECT(%YEAR%,"[YEAR]","Z_VERSION","[ID]='BUD'")
    // Months
    *SELECT(%MONTHS%,"[ID]","Z_TIME","[YEAR]=%YEAR% AND LEVEL='MONTH'")
    *XDIM_MEMBERSET Z_TIME=%MONTHS%   (for ex:My first month is 2009.jan(ope month)
       *WHEN ACCT
               *IS CHC          
            *REC(FACTOR=1, ACCT="CHC",Z_TIME=TMVL(1,%MONTHS%))  ( for ex:2009.feb,nxt month)
        *ENDWHEN
    When i run the above logic in debugger TMVL doesn't show next month.
    If i hardcode time in my xdimmemberset to (*XDIM_MEMBERSET Z_TIME=2009.JAN) and change my TMVL in my REC statement to TMVL(1,2009.JAN)).Logic works fine.
    Please tell me how can we pass dynamic variables to TMVL.
    *REC(FACTOR=1, ACCT="CHC",Z_TIME=TMVL(1,%MONTHS%))
    Thanks

    copying closing bal of prev month to nxt month.
    for ex:
    Account     jan 2009    Feb 2009    Mar 2009
    HC_PLAN     10.00      11.00      21.00
    CHC          10.00      11.00        11
    TI                     1.00                      1.00
    TO                      2.00      1.00          2.00
    AP                      3.00                       3.00
    RT                       4.00                        4.00
    My logic needs to copy values from HC_PLAN (parent) to CHC. I have written ope_bal logic in MS version.
    In NW i cannot use next (i am using TMVL),calc_dummy_org,calc_each_period.
    Please tell me how can i get values from a parent (HC_PLAN).
    Is Calculate_Difference is supported in BPC7.5NW?
    Below is my updated code
    *SELECT(%Year%,"[YEAR]","Z_Version","[ID]='ACTUAL'")
    *SELECT(%Months%,"[ID]","Z_Time","[YEAR]=%Year% AND [LEVEL] = 'MONTH'")
    *XDIM_MEMBERSET Z_TIME=%Months%
    *XDIM_MEMBERSET EB_ACCT = CHC,TI,TO,AP,RT
    *WHEN EB_ACCT
               *IS CHC,TI,TO,AP,RT         
                      *FOR %MonthCopy% = %Months%
                           *REC(FACTOR=1,EB_ACCT="CHC",Z_TIME=TMVL(1,%MonthCopy%))
                        *NEXT
                 *ENDWHEN

  • Script Logic wrong results in migration to BPC 7.5M

    Hi Experts,
    We have an issue with Script Logic calculation after migration of BPC 7.0M to BPC 7.5M. At the beginning we thought that was the issue mentioned in SAP note 1515973, because we had SP03.
    Now we have SP07 and the problems persist. The result of a simply product between two numbers is wrong. For example in the next Default Script Logic:
    *WHEN TIME.GROUP
       *IS INPUT
    *WHEN CATEGORY
         *IS  <> "ACTUAL","B_ACTUAL"
              *WHEN ACCOUNTP             
                    *IS "M_SALES"
                        *REC(FACTOR=GET(ACCOUNTP="PRCT_SALES_BASIC"),ACCOUNTP="700200")
                        *REC(FACTOR=GET(ACCOUNTP="PRCT_SALES_PROMO"),ACCOUNTP="700230")
                        *REC(FACTOR=GET(ACCOUNTP="PRCT_SALES_LIMITED"),ACCOUNTP="700235")             
              *ENDWHEN
      *ENDWHEN
    *ENDWHEN
    *COMMIT
    Input:      M_SALES =           -195,75933
    Input:      PRCT_SALES_BASIC =      1
    Result: 700200 =           -195
    Are there some application parameter that defins de presicion of logic calculations?
    Some ideas? Thanks in advance.
    Best Regards
    Albert

    Hi Jörg,
    We changed to a new server with a multi-server architecture 64 bit (BPC Server and DB Server).
    Did you have the same problem? How do you resolve it?
    Thanks in advance.
    Best regards,
    Albert

  • Regarding RunAllocation Script logic.......................................

    Hi SAP BPC Guys,
                        How to  write code for plan data using Previous data using "runallocation" Script logic?
                       i am also wrote code  for one month. but i don't know how write 12 months?
    //FOLLOWING ADDED TO FIND MONTHS ALREADY PAST
    *SELECT(%MONTHS_GONE%, ID, Time, INPUT=2009.Y)
    *SELECT(%MONTHS_TO_ALLOCATE%, ID, Time, INPUT=2009.Y)
    //*XDIM_MEMBERSET TIME=2009.JAN,2010.JAN
    *XDIM_MEMBERSET A_ACCOUNT=BAS(OperatingExpense)
    *XDIM_MEMBERSET CATEGORY=ACTUAL,PLAN
    *XDIM_MEMBERSET ENTITY=ASA,BAS(RASA)
    //FOLLOWING TO REDUCE INPUT AMOUNT, BY PAST MONTH AMTS
    *XDIM_MEMBERSET Time=2010.INPUT
    *FOR %MT%=%MONTHS_GONE%
    OperatingExpense=OperatingExpense-(OperatingExpense,Time.%MT%)
    *NEXT
    *COMMIT
    //Create total operating Expenses to be allocated.
    *WHEN ENTITY
    *IS "ASA"
    *REC (EXPRESSION=50000,TIME=2010.JAN,CATEGORY=PLAN)
    *ENDWHEN
    *COMMIT
    //Allocate to base countries.
    *RUNALLOCATION
    *FACTOR=USING/TOTAL
    *DIM A_ACCOUNT WHAT=BAS(OperatingExpense); WHERE=<<<; USING=<<<; TOTAL=<<<
    *DIM ENTITY WHAT=ASA; WHERE=BAS(RASA); USING=<<<; TOTAL=<<<
    //*DIM TIME WHAT=>>>; WHERE=2010.JAN; USING=2009.JAN; TOTAL=<<<
    //CHANGED ???? TO 2010.INPUT
    *DIM TIME WHAT=2010.INPUT; WHERE=%MONTHS_TO_ALLOCATE%; USING=2009.JAN; TOTAL=<<<
    *DIM CATEGORY WHAT=>>>; WHERE=PLAN; USING=ACTUAL; TOTAL=<<<
    *ENDALLOCATION
    //Clear the total operating Expenses account
    *WHEN ENTITY
    *IS "ASA"
    *REC (EXPRESSION=0,TIME=2010.JAN,CATEGORY=PLAN)
    *ENDWHEN
    Can u  replay me.
    Thanks.
    Edited by: devi on Oct 5, 2010 10:46 AM

    I can  validate DM Package
    Then i got this Error Msg
    /CPMB/MODIFY : Completed in 0 seconds
    /CPMB/ALLOCATION_LOGIC : Completed in 0 seconds
    /CPMB/CLEAR : Completed in 0 seconds
    [Selection]
    ASARENT=200000
    SOURCE=ASA
    TARGET=RASA
    $SRC_TIME$=2009.INP
    $DST_TIME$=2009.TOTAL
    (Member Selection)
    CATEGORY: ACTUAL,PLAN
    RPTCURRENCY: LC
    TIME: 2008.TOTAL,2009.TOTAL
    [Messages]
    RUN_LOGIC:Member "%DST_TIME%" not exist
    Failed
    Application : PLANNING. Package status: ERROR
    My data manager script is:
    PROMPT(SELECTINPUT,,,,"%CATEGORY_DIM%,%CURRENCY_DIM%,%TIME_DIM%")
    PROMPT(TEXT,%ASARENT%,"How much do you want to allocate?",)
    PROMPT(TEXT,%SOURCE%,"Enter Source Entity",)
    PROMPT(TEXT,%TARGET%,"Enter Target Entities",)
    PROMPT(TEXT,%$SRC_TIME$%,"Enter source .INP time period (i.e. 2009.INP)",)
    PROMPT(TEXT,%$DST_TIME$%,"Enter destination .TOTAL time period (i.e. 2009.TOTAL)",)
    INFO(%EQU%,=)
    INFO(%TAB%,;)
    TASK(/CPMB/ALLOCATION_LOGIC,TAB,%TAB%)
    TASK(/CPMB/ALLOCATION_LOGIC,EQU,%EQU%)
    TASK(/CPMB/ALLOCATION_LOGIC,SUSER,%USER%)
    TASK(/CPMB/ALLOCATION_LOGIC,SAPPSET,%APPSET%)
    TASK(/CPMB/ALLOCATION_LOGIC,SAPP,%APP%)
    TASK(/CPMB/ALLOCATION_LOGIC,SELECTION,%SELECTION%)
    TASK(/CPMB/ALLOCATION_LOGIC,LOGICFILENAME,ALLOCATEHISTORICAL.LGF)
    TASK(/CPMB/ALLOCATION_LOGIC,REPLACEPARAM,ASARENT%EQU%%ASARENT%%TAB%SOURCE%EQU%%SOURCE%%TAB%TARGET%EQU%%TARGET%%TAB%SRC_TIME%EQU%%SRC_TIME%%TAB%DST_TIME%EQU%%DST_TIME%%TAB%)
    My script logic:
    *XDIM_MEMBERSET TIME=2008.TOTAL,$SRC_TIME$,$DST_TIME$
    *XDIM_MEMBERSET P_ACCT=RENT
    *XDIM_MEMBERSET CATEGORY=PLAN,ACTUAL
    *XDIM_MEMBERSET ENTITY=$SOURCE$,$TARGET$
    *WHEN ENTITY
    *IS "ASA"
    *REC (EXPRESSION=$ASARENT$,TIME=2009.TOTAL,CATEGORY=PLAN)
    *ENDWHEN
    *COMMIT
    *RUNALLOCATION
    *FACTOR=USING/TOTAL
    *DIM P_ACCT WHAT=RENT; WHERE=<<<; USING=<<<; TOTAL=<<<
    *DIM ENTITY WHAT=$SOURCE$; WHERE=BAS($TARGET$); USING=<<<; TOTAL=<<<
    //*DIM TIME WHAT=>>>; WHERE=2009.JAN; USING=2008.JAN; TOTAL=<<<
    *DIM TIME WHAT=$SRC_TIME$; WHERE=BAS($DST_TIME$); USING=BAS(2008.TOTAL); TOTAL=<<<
    *DIM CATEGORY WHAT=>>>; WHERE=PLAN; USING=ACTUAL; TOTAL=<<<
    *ENDALLOCATION
    *WHEN ENTITY
    *IS "ASA"
    *REC (EXPRESSION=0,TIME=2009.TOTAL,CATEGORY=PLAN)
    *ENDWHEN

  • Reg: Selectively Commenting Script Logic

    Dear Experts,
    I have a situation where in the Default Logic file comprises of Allocation Logic and Currency Translation Logic, and it works fine.
    But for just one of my reports I have created an Data manager package for Allocation as it uses a different Dimension (Datasource dim instead of Product dim) when compared with the others (which are allocated based on Product).
    The allocation logic works fine if and only if i comment the Allocation Logic present in the Default logic file but this will prohibit the allocation in the remaining reports.
    Is there a way i can restrict the Allocation present in default logic and run only the manually triggered allocation without commenting in default logic so that it works fine for other reports as well.
    Please advice.
    Rgds,
    Rizwan

    I'm a little confused by your use of the word "reports." In BPC, I use the word "report" to mean something very simple -- a view into the data that is stored in the database.
    Any script logic that calculates values (for example, allocations or currency conversion) will post its results to the database. Once those results are in the database, any and all reports which point to those values will retrieve the same result. So it's not possible to have one report retrieve values that are impacted by a data manager package, while other reports ignore that data manager package.
    (However, as soon as I say that, I'll disagree with myself and say, yes of course it's possible -- in the most extreme case, create separate applications for the different business requirements. Or more frequently, use different members in datasrc or some other dimension to isolate the different values.)
    To solve your problem, you need to approach it in terms of the cube (OLAP) data structure, and then your final reports need to either include or exclude, as appropriate, the allocation results. I would recommend you not think in terms of making the code branch in different directions (based on some or other reports). Instead, the logic runs all the time, and the question should be, where do the logic results post to?
    For a very simple example, the currency conversion results always post to USD, EUR, etc. members of the RptCurrency dimension. This logic will never change the original (LC) values.
    For your allocation logic, the same approach can apply. Obviously you wouldn't use the RptCurrency dimension to differentiate the results, but perhaps a datasrc dimension (or something similar) can achieve the result you need.
    For instance think of a datasrc dimension which looks like this, one parent and two children:
    AllDatasrc
    -- InputData
    -- AllocResult
    The allocation logic only considers data in InputData, and posts the results to AllocResult. The other reports (which should not reflect the allocation) are focused on InputData, while the allocation report looks at AllDatasrc, or possibly even all 3 members to show the "before and after"
    Once you make that change, you need to decide how it impacts everything else in the application. The currency conversion logic, perhaps should now include both InputData and AllocResult. That's up to you to decide.

  • Script Logic in BPC is not working properly

    Hi All,
    I have the BPC Microsoft version 7.0.114. I am trying to create a script logic to calculate price x units.
    I have an application called GYP with the following dimensions:
    PL (Account type) in this dimension are the units
    Time
    Category
    Entity
    Product
    RptCurrency
    I have another application called PRICE with the following dimensions:
    Price  (Account type) in this dimension are the prices
    Time
    Category
    Entity
    Product
    RptCurrency
    The script logic i created in the GYP application is as follows:
    *XDIM_MEMBERSET PL="Units"
    *XDIM_MEMBERSET PRODUCT=<ALL>
    *XDIM_MEMBERSET ENTITY=<ALL>
    *XDIM_MEMBERSET CATEGORY="Budget"
    *LOOKUP PRICE
    *DIM PR:PRICE ="PRICES"
    *ENDLOOKUP
    *WHEN PL
    *IS "Units"
    *REC(FACTOR=LOOKUP(PR), PL="Revenues")
    *ENDWHEN
    *COMMIT
    I also put in the default.lgf :
    *INCLUDE UnitsxPrice.LGF
    *COMMIT
    I have loaded data for units and price only for one product to validate the script logic but I'm not getting any calculated value in the revenues element.
    I have read a lot of documentation about script logic but i haven't found which could be the problem.
    Please, could you help me to know what i am missing to?
    Thanks in advance for all your help.
    Regards,
    Luisana

    Hi,
    Your script logic looks fine to me. However, I would request you to make a small change in your default logic.
    Lets say that you created the script logic with the name CALCULATION.LGF, then the default logic should look like below:
    *INCLUDE CALCULATION.LGF
    Notice that the name of the script logic should be consistent (and I have removed the commit statement from the default logic).
    Hope this helps.

  • Script logic not working

    Hi all,
        we have been using this logic in versions 4.2 and 5.1.  just brought our apps over to  new 7.5  sql environment and the logic did not  work. Nothing changed in logic or in dimensionality. System seems to be ignoring any *WHEN IGNEDDATA   checks.
    It appears that evaluation of signeddata doesn't work in version 7.5 in  SQL. loaded multiple data templates and also run countless default  logic packages. Always fails to calculate the required accounts only when involving logic . Other script  logic packages work fine. 
    Regards,
    Srini

    Hi Srini,
    Can you please share the script, you are using?

  • Script Logic: Using a property in MDX *REC statement (BPC NW)

    Hi,
    Is it possible to use a Property in an MDX statement without using  *LOOKUP() function? I have script successfully working but it takes 15 minutes to execute and would like to speed it up.
    I understand that [DIMENSION].[MEMBER].Property is not valid syntax, and do not believe NW has any other functions to resolve the issue, except *LOOKUP which takes a long time.
    Specific Example is below:
    I have a piece of script that successfully splits JV Expense by customers. A Profit Share planning driver determines the percentage that each customer is entitled to. Typically this will be 100%, but could be 50% between two customers.
    The PROFIT SHARE planning drivers records, and PARTNER_INCOME transactional records are below:
    ACCOUNT
    ENTITY
    PARTNER
    SIGNED DATA
    PROFIT_SHARE
    UK_001
    PARTNER_A
    0.5
    PROFIT_SHARE
    UK_001
    PARTNER_B
    0.5
    PROFIT_SHARE
    UK_002_PLANNING_DRIVERS
    PARTNER_B
    1.00
    PARTNER_INCOME
    UK_001
    NO_PARTNER
    $5,000
    PARTNER_INCOME
    UK_002
    NO_PARTNER
    $5,000
    UK_001 has two partners that are each entitled to 50% of the $5,000 NET PROFIT.
    For UK_002, one one single Partner is entitled to 100% of the $5,000 NET PROFIT.
    Using script logic, you can scope the Profit Share account (PROFIT_SHARE) - , and use a *REC statement to multiply this by the driver. It would look like:
    *XDIM_MEMBERSET ACCOUNT = PROFIT_SHARE
    *WHEN ACCOUNT
    IS *
    *REC (EXPRESSION = %VALUE% * ([ACCOUNT].[PROFIT_SHARE],[PARTNER].[NO_PARTNER]), ACCOUNT = PARTNER_PROFIT_SHARE)
    *ENDWHEN
    This wouldn't be a problem if the Planning Driver is always stored on the same Entity that the Income is stored on, but for UK_002, the planning driver is stored on another Entity - which is stored in a the PLAN_DRIVER_REF property of the entity. It should use UK_002_PLAN_DRIVERS
    ID (Entity)
    PLAN_DRIVER_REF
    UK_001
    UK_002
    UK_002_PLAN_DRIVERS
    UK_002_PLANNING_DRIVERS
    In this scenario, we need to switch out the Entity used in the MDX, however I do not believe you can use a property in MDX - can anyone confirm?
    I have currently implemented the *LOOKUP functionality to loop through, changing each *LOOKUP partner for each loop.
    Lookup:
    *LOOKUP PLANNING_JV_US
    *FOR %LOOP_ASLS% = %ASL_LOOKUP_LOOP_VARIABLE%        
      *DIM LOOK_%LOOP_PARTNERS%:ACCOUNT = "PROFIT_SHARE"
      *DIM LOOK_%LOOP_PARTNERS%:PARTNER= %LOOP_PARTNERS%
    *NEXT
    *DIM ENTITY = ENTITY.PLAN_DRIVER_REF                   //   Use PLAN_DRIVER_REF Property of Entity
    *ENDLOOKUP
    Scope and *REC:
    *XDIM_MEMBERSET ACCOUNT = PROFIT_SHARE
    *WHEN ACCOUNT
    IS *
    *FOR %LOOP_PARTNERS% = %PARTNER_LOOKUP_LOOP_VARIABLE%      // 1000 Partners
    *REC(EXPRESSION = %VALUE% * LOOKUP(LOOK_%LOOP_PARTNERS%), PARTNER= %LOOP_PARTNERS%, ACCOUNT = TCOJVSHAR_CALC, AUDIT_ID = PP_EXPENSE_BY_PARTNER)
    *NEXT
    *ENDWHEN
    The problem with the above, is that because the Lookup is being generated for every single Partner, there are significant numbers of loops.
    Does anyone know of another way this can be implemented in Script Logic? Otherwise we'll need to explore BAdI route.
    Thanks,
    Nick

    Hi Nick,
    Use property in LOOKUP - will dramatically speed up the calculation without FOR/NEXT.
    Vadim

  • How to auto-update of script logics after adding new dimension members?

    Hi Experts,
    Just wanna ask if BPC has a functionality that would automatically update/validate and save my script logic whenever I add new dimension members. I've added new PL accounts but they are not automatically added to my calculated BS Net Income. I had to re-validate and save my logic for it to be included in my logic and for the amounts to be computed correctly.
    Thanks,
    Marvin

    Hi Marvin,
    There is no functionality as such. we need to configure the script as and when we make any changes in the dimension members.
    Regards
    Raman

  • SQL functions in Script Logic

    I want to build a script logic but the dimensions that I am testing do not have the fields I want in the format I want. In my case I would like to test the "Start" property in the Employee dimension. The property represents the employee start date but is a var char in the format dd.mm.yyyy rather thna a date field. I want to test whether it is five years prior to the date being processed.
    My time dimension has a year property and a monthnum property. Each of these are varchar. I can write SQL that would convert these to a date and compare them with the start property on the employee dimension.
    Can I  do iinsert SQL functions in the When statement. An example would be
    *When convert(datetime, substring(employee.start,4,2) + '/' + substring(employee.start,1,2) + '/' + substring(employee.start,7,4))
    Can I use  SQL functions in the Is statement? An example would be
    *Is <DateAdd(YY,-5 , convert(datetime, Time.Monthnum + '/01/'' + time.year)
    Finally when I use such techniques and look at the log by using "show log" in the logic debugger I see no reference to the SQL I used. It is as if the generated SQL has not made use of my functions. Instead all I seee are the extract statements from the three fact tables. Is this normal? Is there a way to see what SQL is really being generated and run?
    At the moment it seems my only option is to make changes, try running it and hope I get an output. If no records are written I can't be sure whether it is because embedding SQL function is not supported or because I have made some other error.

    No, the "BPC SQL" script logic doesn't allow for this extensive use of real SQL within the scripting syntax. As a concept, it's best to think of "BPC SQL" script logic as, "this unique BPC logic syntax will generate real SQL code when it's executed."
    There's very little real SQL that you can use within the syntax itself, and definitely not within the WHEN or IF statements.  Nothing like cast, convert, substring, etc. (Except you CAN use these, a little bit, in a *SELECT statement. But I don't see how that will solve your current problem.)
    Plus, when you consider how the logic engine processes a set of data, it's helpful to think of it in terms of selects & reading through a recordset. So in that regard, a SQL background can be helpful, in understanding the concepts. (Sort of helpful, except when it confuses you, or frustrates you since you don't have all the power you want.)
    Anyway, to solve your problem, you might be able to restate the problem, and then use something like this code, which is valid syntax:
    *WHEN TIME.TIMEID
    *IS >= VERSION.FirstPlanMonthTimeID
    In this case, FirstPlanMonthTimeID is set up in the version dimension as, for example, 20090400 (representing 2009.APR). This timeID is set by BPC automatically when processing the time dimension, and I need to ensure that my Version property value is set to match it.
    A key point is that in BPC fact tables, the time dimension is stored as TIMEID (not ID, unlike all the other dimensions), and can be used for comparative evaluation in script logic WHEN/IF. The comparison property needs to be stored as an 8-digit integer value. If your time dimension has days in it (along with months), check the TIMEID after processing, and you should see the pattern for assigning values to TIMEID for days and months, etc.
    Normally, TIMEID is assigned pretty sensible and stable values. If it doesn't meet your logic requirements, you can create another property (be careful of USERTIMEID, since that has a specific purpose in the system which I've never fully understood) and assign that whatever (integer) values make sense.

  • BPC 7.5 MS SP5 wrong numbers multiplying GET (A)*GET(B) in script logic

    Hi experts,
    We are migrating from BPC 5.1 MS to 7.5 MS SP5 and there have some scripts that are using GET function that retrieve wrong numbers. Particularly, it does not record the decimals figures.
    Example1 (multiply): when A=2,3 and B=4,4, then AB=10,12. But doing this in script logic GET(A)GET(B)=10. It does not write the decimal figures.
    Example2 (addition): when A=2,3 and B=4,4, then AB=6,7. But doing this in script logic GET(A)GET(B)=6. It does not write the decimal figures.
    Particularly, the script we are executing is the following. This script worked ok at 5.1 but not at 7.5:
    *XDIM_MEMBERSET ACCOUNTL= INFLA_AUX,INFLA_ACUM
    *XDIM_NOSCAN ACCOUNTL = INFLA_ACUM
    *XDIM_MEMBERSET CATEGORY=%CATEGORY_SET%
    *XDIM_MEMBERSET CURRENCY=LC
    *XDIM_MEMBERSET TECHNOLOGY = %TECHNOLOGY_SET%
    *XDIM_MEMBERSET PEM=DESCENDANTS([PEM].[PEMTOT],999,LEAVES)
    *XDIM_MEMBERSET TIME=DESCENDANTS([TIME].[XXXX.TOT],999,LEAVES)
    *CALC_EACH_PERIOD    
    *WHEN ACCOUNTL
    *IS INFLA_AUX
         *WHEN TIME.YEAR
         *IS = PEM.YEAR
    *REC(EXPRESSION=1,NOADD,ACCOUNTL=INFLA_ACUM)
                *IS < PEM.YEAR
    *REC(EXPRESSION=0,NOADD,ACCOUNTL=INFLA_ACUM)         
                *IS > PEM.YEAR
    *REC(ACCOUNTL=INFLA_ACUM,NOADD,EXPRESSION=GET(ACCOUNTL="INFLA_ACUM",TIME=PRIOR) * GET(ACCOUNTL="INFLA_AUX",TIME=PRIOR))     //in this sentence!!!!!!
              *ENDWHEN
    *ENDWHEN
    *COMMIT
    We have SIGNED_DATA_FORMAT (25,10) in the application parameters.
    Many thanks for your attention.
    Best regards,
    Arkaitz
    Edited by: arkaitz_orozko81 on Apr 28, 2011 4:31 PM
    Edited by: arkaitz_orozko81 on Apr 28, 2011 4:33 PM

    Hello,
    We have solved this issue.
    First, we have change the script:
    *SELECT(%PEM_APLICA%,[ID],PEM,"APLICA='Y'")
    *XDIM_MEMBERSET ACCOUNTL=PROD_AUX,DISP_INP,HORA_AUX,CAPAC_AUX
    *XDIM_NOSCAN ACCOUNTL= PROD_AUX
    *XDIM_MEMBERSET CATEGORY=%CATEGORY_SET%
    *XDIM_MEMBERSET CURRENCY=LC
    *XDIM_MEMBERSET TECHNOLOGY=DESCENDANTS([TECHNOLOGY].[RENOVABLES],999,LEAVES)
    *XDIM_MEMBERSET PEM=%PEM_APLICA%
    *XDIM_MEMBERSET TIME=<ALL>
    *WHEN ACCOUNTL
    *IS CAPAC_AUX
    //*IS *
         *WHEN SIGNEDDATA
         *IS <> 0
    REC(ACCOUNTL="PROD_AUX",NOADD,EXPRESSION=GET(ACCOUNTL="CAPAC_AUX")* GET(ACCOUNTL="DISP_INP")* GET(ACCOUNTL="HORA_AUX"))
         *ELSE
    *REC(ACCOUNTL="PROD_AUX",NOADD,EXPRESSION=0)
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    And we have change the regional settings to "English (United States)".
    Many thanks for your answer.

  • Use of comments in script logic / BADI

    Hi,
    Does anyone knows whether one can read the comments entered in an input schedule in a script logic or BADI? Depending on the text entered in a comment, a certain planfunction has to be executed during save ...
    the user should be able to easily change a dimension value in an input schedule:
    Product    Product group    Key figure 1     Key figure 2
    A             A1                     10                       30
    -> the user easily needs to change the product group from A1 into B1 . When doing so the values of key figure 1 and 2 need to be copied to the new product group and the original values on A1 have to be removed. we cannot set up the product group as a propoerty since one should be able to compare multiple versions with different assignments ... So we were thinking to add an additional comment column in which the new value can be assigned to. When save, it should read the comment and perform the planfunction ... Would this be possible?
    D

    HI D-
    Possible, but you would probably need to create a Badi to accomplish all the logic...
    For a start, you would need to be able to find the comments...the naming convention for the dynamic comment table is:
    /1CPMB/application_set_prefixapplication_prefixCMT
    The two character application_set_prefix can be identified from the table UJA_APPSET_INFO, and the two character application_prefix can be identified from the UJA_APPL table.   
    Once the comment table is identified you could create a custom Badi to look up comment information to direct processing of specific records.   
    Regards,
    Sheldon Edelstein

  • Logical Error in Script Logic

    Hello Experts,
    Please provide your guidance for the following scenario.
    I need to calculate the 'Accumulated Depreciation' for every month, based on the amounts in the 'AccumDep' and the 'Depreciation' accounts.
    In other words, the value of the Accumulated Depreciation for the month of Feb should be equal to (Accumulated Depreciation in Jan + Depreciation in Jan), and so on.
    To accomplish this, I have written the following script logic.
    *WHEN ACCOUNT
    *IS AccumDep, Depreciation
         *FOR %MON% = 2009.FEB,2009.MAR,2009.APR
              *REC(FACTOR=1, ACCOUNT=AccumDep, TIME=%MON%)
         *NEXT
    *ENDWHEN
    *COMMIT
    The above logic was validated without any 'syntax' errors.  However, I do not see the desired results, as the Accumulated Depreciation is not getting updated every month.  The amount from FEB appears for MAR & APR also.
    Therefore, could you please review the above script and let me know if there are any 'logical' errors?
    All your guidance is greatly appreciated.  Thanks...

    Hi,
    You are not getting the desired result because you are trying to aggregate the depreciation and the accumulated depreciation of the same month and post the result again in the same month. Lets say the code is working for 2009.MAR. You are trying to add the depreciation and accumulated depreciation of 2009.MAR. However, you still dont have the acc depreciation of 2009.MAR. You basically need to take the acc depreciation of the previous month.
    You can try something like:
    *WHEN ACCOUNT
    *IS Depreciation
         *FOR %MON% = 2009.FEB,2009.MAR,2009.APR
              *REC(EXPRESSION = %VALUE% + ([ACCOUNT].[AccumDep],[TIME].Previous), ACCOUNT=AccumDep)
         *NEXT
    *ENDWHEN
    *COMMIT
    You can have a property called Previous to store the previous month of each period in the time dimension.
    Hope you got the idea.

Maybe you are looking for

  • Deploy JDBC drivers - SAP PI 7.0

    Hi guys, I have to deploy JDBC drivers to implement JDBC adapter in SAP PI 7.0. I've found some guides for XI 3.0 or SAP PI 7.1 but not to SAP PI 7.0. Can I apply guide for XI 3.0 or another exists? Best regards, Pablo

  • "the item you selected is not available in the uk"

    I can't access the iTunes store even though I am in the UK. it's a new computer with the latest version of iTunes downloaded and running away fine but this is killing me. any help appreciated, been through all the help topic and they come up against

  • Need to automate DVD Production

    I have customers who buy customized DVDs. The customer selects about 30 short training videos from a library of about 1000. The order arrives as a text listing of the videos that need to end up on DVD. I need to automate the process of putting those

  • Mysql_num_row in java

    hi im designing a database program with java but i cant find the way to return the number of column count which is appropriate to my query in php i used to mysql_num_row function are there anything like this in java? Ps: I'm using mysql-connector-jav

  • (cross post) Batch of two folders in...

    I have two folders with image sequences. I would like to run a batch of some sort, which opens one file from each folder, copies one of the images into a new layer of the other, then saves the results to a new folder, and continues. Is this possible?