Script Logic using when Condition

Hi,
Im working on BPC 7.5 SP04 MS and I cant figure out how to make this logic work:
1. Cuenta members (account) with the ivaacred property, are multiplied by a certain value  and stored in the account 13010A
*WHEN TIEMPO
*IS  2009.Jan, etc  etc.....
*WHEN CUENTA.IVAACRED
*IS "Y"
*REC(EXPRESSION=%VALUE% * GET(METRICAS="IND.IVA"),CUENTA="13010A")
2. When the data values for the cuenta 13010A  are  <= 0, then multiply them by zero  and post them in the same account, else leave them the same way.
*WHEN CUENTA 
*IS 13010A
IS <= 0
*REC (EXPRESSION = %VALUE% * 0, CUENTA="13010A")
*ENDWHEN
Thanx in advance
Velázquez

Hi Karthik,
The hierarchy you understood is correct
OUTSOURCING (Parent)
s_outsourcing (Son)
O_Gastos (Son)
This is an example of our report, what we look for in our script...
We want the  calc to be applied  to the parent values, instead of doing the roll up.
Area= s_outsourcing
Income = 100,000  
Costs = 0  
EBITDA = 100,000  
ISR (30%) = 30,000  
Area= O_Gastos     
Income = 0     
Costs = -50,000     
EBITDA = -50,000       
ISR = 0     
Outsourcing                         
Income = 100,000                         
Costs = -50,000                         
EBITDA = 50,000                         
ISR = 30,000 --> WRONG!!!
Correct answer = EBITDA * 30% = 15,000

Similar Messages

  • [ASK] Error in Script Logic Using WHEN

    Hello guys.
    Script logic :
    *XDIM_MEMBERSET CATEGORY = %CGY_PLAN%, %CGY_FORECAST%
    *XDIM_MEMBERSET ACCOUNT = <ALL>
    *XDIM_MEMBERSET ENTITY = <ALL>
    *XDIM_MEMBERSET TIME = %YEAR_TTL%
    *XDIM_MEMBERSET VEHICLE = <ALL>
    *XDIM_MEMBERSET BUDGET_ACT = <ALL>
    *WHEN CATEGORY
    *IS %CGY_PLAN%  // Error
      *WHEN TIME
      *IS %YEAR_TTL%
        *REC(CATEGORY = %CGY_FORECAST%, TIME = %YEAR_TTL%)
      *ENDWHEN
    *ENDWHEN
    *COMMIT
    When i validate, it is error for statement : *IS %CGY_PLAN%.
    But if that statement i change into : *IS %YEAR_TTL%; it isn't error.
    Why is this happen ? How to correct it ?
    Thank you.

    Hi,
    You have 3 variables in your script - CGY_PLAN, CGY_FORECAST, and YEAR_TTL.
    Are you passing the values to these variables through DM package?

  • Execute script logic using data manager

    Hi all,
    Could anyone explain me how to run a script logic using the data manager?
    The only way I get it working is adding the script logic into the defaul.lgl file and running the default formulas package via data manager.
    How can I run an specific script logic without using the default.lgf file?
    Thanks and regards,
    Ana

    HI Ana,
    You will have to create a SSIS package that will run the logic for you. A good example of this is the ICELIM package that comes standard with AppShell. The easiest is way for me is to copy the package and renaming it to what you want to call it in the following folder: C:\BPC\Data\Webfolders\<AppSet>\<Application>\DataManager\PackageFiles\System Files
    You will then have to organize the package list and add the package and modify the advanced properties of the package and point it to the correct logic file. I always use the lgf file rather than the lgx file, but it is up to you.
    Lemme know if you need more info.
    Regards,
    Andries

  • How to create a script logic using two applications and some conditions?

    Hi All,
    I am using BPC 7.0 MS
    I have two applications, one called RATE (Dimensions: Category, InputCurrency, Rate, RateEntity, Time) and one called GYP (Dimensions: Category, Entity, PL, Producto, RptCurrency, Time. In the GYP application for Revenues. I have the followings products:
    Product code
    1-808-912-433
    3-208-345-542
    11-869-789-946
    13-456-786-890
    I need to calculate a discount using the first digits to identify the product: 1, 3, 11 and 13, based on some percentages that are in the RATE application. 
    I have an element in the RATE application for each one of them.
    DPC1
    DPC3
    DPC11
    DPC13
    What I am trying to do in the script logic is:
    *XDIM_MEMBERSET PL=Revenues
    *XDIM_MEMBERSET PRODUCTO=<ALL>
    *XDIM_MEMBERSET ENTITY=<ALL>
    *XDIM_MEMBERSET CATEGORY=Budget
    *LOOKUP RATE
    *DIM D1:RATE ="DPC1"
    *DIM D11:RATE ="DPC11"
    *DIM D3:RATE ="DPC3"
    *DIM D13:RATE ="DPC13"
    *DIM RATEENTITY="Global"
    *DIM INPUTCURRENCY="VEB"
    *ENDLOOKUP
    *WHEN PL
    *IS Revenues
    *REC(FACTOR=LOOKUP(D1), PL=Discount)
    *ENDWHEN
    *COMMIT
    In the WHEN area, i would like to create some condition to identify the product and assign the correct percentage to it but i don't know how to do it?
    Do you have any suggestions?
    Also, because i need to key the values in the RATE application for the discounts, the logic should be run from this application?
    Using RUNLOGIC like this:
    *RUNLOGIC
    *APP GYP
    *LOGIC Discounts
    *ENDRUNLOGIC
    Best regards,
    Luisana

    Hi Nilanjan,
    Thanks for your prompt reply.
    The special characters ("-") cannot be used. The product codes use the special character ("_").
    I understand what you said about the property for the dimension Product but not for the dimension Rate. I have the lookup that has the four elements (DPC1, DPC11, DPC3, DPC13). It is not supposed to get the data from those elements directly when using the lookup?
    The script logic is still not working. I created the dimension property in the product dimension and the new script logic is as follows:
    *XDIM_MEMBERSET PL=Revenues
    *XDIM_MEMBERSET PRODUCT=<ALL>
    *XDIM_MEMBERSET ENTITY=<ALL>
    *XDIM_MEMBERSET CATEGORY=Budget
    *LOOKUP RATE
    *DIM D1:RATE ="DPC1"
    *DIM D11:RATE ="DPC11"
    *DIM D3:RATE ="DPC3"
    *DIM D13:RATE ="DPC13"
    *DIM RATEENTITY="Global"
    *DIM INPUTCURRENCY="VEB"
    *ENDLOOKUP
    *WHEN PRODUCT.TYPE
         *IS 1
              *REC(FACTOR=LOOKUP(D1), PL=Discount)
         *IS 11
              *REC(FACTOR=LOOKUP(D11), PL=Discount)
         *IS 3
              *REC(FACTOR=LOOKUP(D3), PL=Discount)
         *IS 13
              *REC(FACTOR=LOOKUP(D13), PL=Discount)
    *ENDWHEN
    *COMMIT
    Could you let me know what i am doing wrong?
    The calculation i would like to get is: Discount = Revenues(GYP) X DPCx(RATE)
    Also, when I sent the data from the rate application I get the message "ExecuteBaseLogic::invalid application:*APP GYP". I am using a RUNLOGIC in the application RATE with the following code:
    *RUNLOGIC
    *APP GYP
    *LOGIC Decto_en_vtas_pilot
    *ENDRUNLOGIC
    Kind Regards,
    Luisana

  • 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

  • Script Logic error when trying to Calculate P*Q

    I am new to MDX and Script Logic and need some help. 
    I am trying to calculate Price * Qty.  Prices are stored in an Account called Unit_Price, and Qtys are stored in Accounts as well.  We have a Service property called "DRIVER" that points to the Account that holds the Q for that Service, but I can't seem to refer to it in Script Logic.  So, for each Service, I want to find the corresponding Unit_Price, lookup the Driver for that service and then use that to find the corresponding Quantity.  However, I'm having trouble with the portion that points to the Quantity. 
    Can someone please help? 
    This is the error that I get when I try to run it in the Logic Debugger: 
    "Warning no. -2147467259 reading cell 0; The hierarchy '[SERVICE.DRIVER]' was not found in the cube when the string, [ACCOUNT].[SERVICE.DRIVER],was parsed. "
    Here is my Script Logic:
    *MEMBERSET(%BILL_ENTITY%,FILTER(DESCENDANTS([ENTITY].[547],99,LEAVES), [ENTITY].CurrentMember.Properties("BILLED_ENTITY")="X") )
    *XDIM_MEMBERSET ENTITY = %BILL_ENTITY%
    *MEMBERSET(%PQ_SERVICE%,FILTER(DESCENDANTS([SERVICE].[TOTAL_SERVICE],99,LEAVES), [SERVICE].CurrentMember.Properties("ALLOC_METHOD")<>"") )
    *XDIM_MEMBERSET SERVICE=%PQ_SERVICE%
    *XDIM_MEMBERSET CATEGORY = %CATEGORY_SET%
    *XDIM_MEMBERSET TIME = %TIME_SET%
    *XDIM_MEMBERSET DATASRC = INPUT
    *FOR SERVICE.ALLOC_METHOD = "PQ" 
                [ACCOUNT].[#16404ZZZ] = ( [ACCOUNT].[UNIT_PRICE], [TIME].currentmember) * ([ACCOUNT].[SERVICE.DRIVER], TIME].currentmember)
    *NEXT           
    *COMMIT

    1. completely uninstall all the nokia PC Suite products with this http://nds1.nokia.com/files/support/global/phones/software/Nokia_PC_Suite_Cleaner_7_1_1.exe, and also uninstall all OVI Suite products
    2. reboot pc
    3. download & Install a fresh copy of PC Suite
    4. it will then have you download and install a new version of the software installer after you connect your e90
    it should be fine after that. i had to do the same thing a while back.
    re: no able to sync the calendar with ovi suite:
    go to the Sync drop down and then select Sync Calendar.
    hope that helps

  • Script logic using Dimension.Property

    Hello, Gurus!
    I have next problem with script logic:
    Dimension Company
    Company1
    Company2...
    Dimension Document
    Document1
    Document2...
    Dimension Document has property PCompany, where there is Company ID.
    I need to summation all data for Company=Company2 (for example).
    How can I choose records from Dimension Document for PCompany=Company2 with BPC script logic?
    Thanks!
    Regards,
    Svetlana.

    Hello Gersh!
    Thank you very much. It's worked.
    I should clarify the question
    I have several company which I choose with property of Company (for example, INTERCOMP=Y)
    So, I have :
    *SELECT(%COMPANY%,ID,COMPANY,INTERCOMP=Y)
    *WHEN Document.PCompany
    *IS  %COMPANY%
    *ENDWHEN
    This construction doesn't work.
    Regards,
    Svetlana.

  • Use BADI or LGF script logic? Which is good in performance

    Hello,
    I have a situation wherein a choice is to be made among the "BADI" or "script logic" having DESTINATION_APP which is along with WHEN clause.
    Below is the code in which WHEN clause is used:
    Code Starts****
    XDIM_MEMBERSET CATEGORY=FC_CUR
    *DESTINATION_APP=GROSSMARGIN
    *SKIP_DIM =WEEK
    *ADD_DIM PLAN_PARTNER = PP_NA, RPTCURRENCY = LC
    *WHEN CATEGORY     
        *IS "FC_CUR"     
                  *REC(EXPRESSION=%VALUE%)
    *ENDWHEN
    *****Code Ends****
    The business requirement could be changing as we are at initial stage, wherein i may have to incorporate some data mapping logic which can also be handled through scripts instead of using BADI.
    The major concern is if BADI would be most prefferable over script logic having WHEN clause to acheive the optimal performance considering large no. of records that needs to be written to the target APPLICATION
    from the source application?
    OR
    The script with WHEN statement is fine if the data mapping is pretty simple and would not have much impact on performance compared to using of BADI even if the records to be moved is huge.

    If data mapping is simple you can opt for script logic . If requirement is complex then you can go for BADI . You can check this [How-to|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70187b3e-d5ce-2d10-d780-bb8b1a5b0bdc?QuickLink=index&overridelayout=true] 6 th page on performance considerations of BADI .
    A well designed BADI implementation is faster than script logic

  • Script logic folder empty!

    Hello every body,
    After installing Patch1 of BPC MS 7.5 SP04  I had a problem with script logic folder when expanding the Legal application in the Admin console. The folder is empty, no Logic found, even the Default.LGF!!!
    When I try to create a new one through the "Create New Logic" link in the Action Pane, I get this error displayed:
    System.IO.DirectoryNotFoundException: Could not find a part of the path 'E:\BPC\Data\Webfolders\<AppSet>\AdminApp\Legal(my application)'
    When I tried to access this path I didn't find it, I found: 'C:\PC_MS\Data\Webfolders\<AppSet>\AdminApp\Legal' instead.
    PS:I performed an update for the client with an Admin Account, after installing the patch.
    Any help?
    Thank you in advance.

    Hello,
    Thank you nilanjan for your reply
    We have resolved the issue.
    The problem was that on the BPC server on OS level the folder E:\BPC was not shared and we have added the everyone group to have access to the folder and now all the users that are using the BPC client can see the content of the Script logic in BPC Admin.
    The File Share Server was pointing to E:\BPC\Data but the folder BPC was not shared and we have added the group: Domain Users to access the network path. Now we can see all the files in the appset  Production \ Application \Legal\ Script Logic . We can create a new Script logic with success.
    Thank you.

  • Calling a script logic through Excel Formulas/Macro

    Hi All,
    Can anyone suggest how to execite a script logic directly from excel without users requiring to make any further selections
    Our business scenario is as follows:
    We need to run a script logic everytime, when data is saved from a particular template(Not from all the templates).
    Hence we cannot use the default logic. When the user clicks on the save button(it is a macro which sends the data to the server) it should also execute  that particular script logic without any further selections.
    Please suggest on this . Let me know incase any furher information is required on this.
    Thanks in Advance.
    Regards,
    Chandra

    Hi VinooGAN,
    Yes, I need to run the script logic for a specific set of accounts for which data is entered from a specific tenmplate.
    In other words, that scriptlogic has to be executed only when the data is sent from that particular template.
    We have a save button(Excel TAB) in the template which is  the macro to send the data after the user enters data in the sheet.
    So the macro lines should be such that, once the user clicks on that save button of that particular sheet, the script logic should also run(Without users having to make any further selections) automatically.
    Regards,
    chandra

  • 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.

  • Rounding up in script logic

    Dear all,
      I am using BPC 7.0 MS
      I tried to perform rounding up in script logic using Round and a negative number, but it didn't work.
      Any other suggestions?
    Cheers,
    Lip Chean

    So in this case you might need to use division instead of multiplication, for example:
    (int(28/100)+1)*100
    In my previous example I was assuming that you might need to get rid of two decimals and round to the full currncy unit.
    cheers,
    Madis
    Edited by: Madis Udam on Mar 17, 2010 9:30 PM
    Edited by: Madis Udam on Mar 17, 2010 9:31 PM

  • 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

  • Calling  multiple  script  logics from  a  single  package

    Team- How  do i  call multiple  script  logics  from a   single  DM  package...?
    I   know  its  possible  and  have seen  a  prototype  but  cant  recollect  or  find  it on sdn...
    Thanks  for  your  time.
    Vishal.

    Hi,
    You can create a master script logic which will include all the other script logics using the *INCLUDE command and call this master script through your DM package.
    Another way is to have multiple tasks in the process chain which is calling a script logic. You can pass separate script logics to each of the tasks.
    I would prefer the first option
    Hope this helps.

  • Script Logic EDI

    Hi!
    Does anyone know if there is script logic (sap bpc) EDI?
    Thankxx!!

    HI,
    I don't know what is EDI.
    But SAP BPC has a script logic used to create calculation for aggreate members.
    Regards
    Sorin Radulescu

Maybe you are looking for