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

Similar Messages

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

  • 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

  • [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?

  • Concatenating a property in a REC statement

    In a *REC statement I need to append a property value to a string to define the Account and have tried several iterations around the following without success:
    *REC(EXPRESSION=%VALUE%,ACCOUNT=1210_ENTITY.ACCTSUFFIX)
    Where the Entity.AcctSuffix property may contain ABC, so the result I would expect would be 1210_ABC
    I thought I had seen a similar thread in the past but cannot locate it, so my apologies if I'm duplicating a previous discussion
    Any suggestions/guidance would be appreciated.

    I have exactly the same situation working for me  where I need to map data from a monthly to a weekly application, where I say:
    *REC(TIMEDIM=TIMEDIM.YEAR.WMYTARGETWEEK
    In this case MYTARGETWEEK is generated by a *SELECT used in a *FOR statement resulting in a weeknumber. and the ".W" are putted correctly in between.
    so the result is a timemember like 2008.W52. But in this case the property is also the first part of the membername. So trying to relabel the account and testing the logic the other way around like Alwin suggests might be worth trying.
    -Joost

  • 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

  • Script logic to calculate average value on nodes - SAP BPC NW 10.0

    Hi experts,
    I need to have in the parent members of the dimension TIME (2014.Q1, 2014.Q2,  2014.Q3, 2014.Q4, 2014.TOTAL) the average value of  their children and not the sum. For example :
    2014.01        2014.02         2014.03        2014.Q1
        1                  2                    3                  2                                          
    2 = AVG(1, 2, 3)
    I tried the script bellow but it doesn't work , it throws the error " ReferenceError : AVG is not defined"
    *SELECT(%TIMESET%,"[ID]",TIME,"[CALC]='Y'")
    *XDIM_MEMBERSET TIME = %TIMESET%
    *XDIM_MEMBERSET MEASURES = PERIODIC
    *WHEN DIM1
    *IS C02
    *WHEN TIME
    *IS %TIMESET%
    *REC(EXPRESSION = AVG(Descendants([%TIMESET%].CURRENTMEMBER)), TIME = %TIMESET%)
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    How can I achieve this ?
    Thanks
    Maha

    The best way is to enter 2 accounts: Productivity and Area, calculating by dimension member formula:
    ProductivityPerHectare=IIF([Area]=0,NULL,[Productivity]/[Area])
    If you have to enter ProductivityPerHectare and Area, then in script you can calculate Productivity:
    *WHEN ACCOUNT
    *IS Area
    *REC(EXPRESSION=%VALUE%*[ACCOUNT].[ProductivityPerHectare],ACCOUNT=Productivity)
    *ENDWHEN
    *WHEN ACCOUNT
    *IS ProductivityPerHectare  //user input
    *REC(EXPRESSION=%VALUE%*[ACCOUNT].[Area],ACCOUNT=Productivity)
    *ENDWHEN
    Then dimension member formula:
    ProductivityPerHectareCalc=IIF([Area]=0,NULL,[Productivity]/[Area])
    You can use arithmetic average of ProductivityPerHectare only if Area is always constant.
    In this case you can create some dummy account member DUMMY and fill it with 1:
    *WHEN ACCOUNT
    *IS ProductivityPerHectare  //user input
    *REC(EXPRESSION=1,ACCOUNT=DUMMY)
    *ENDWHEN
    Then dimension member formula:
    ProductivityPerHectareCalc=IIF([DUMMY]=0,NULL,[ProductivityPerHectare]/[DUMMY])
    Vadim

  • Script Logic - REC Statement

    Hi,
    Can we use dimension property value in REC statement?
    *REC(EXPRESSION = %value%/[TIME].CURRENTMEMBER.PROPERTIES("ACCTHRS"),ACCT_PROJECT="FTE_DIRECT_BASE")
    WHEN I PROCESS THE SCRIPT LOGIC I AM GETTING AN ERROR "INVALID LINE IN LOGIC SECTION: *REC........"
    THANKS

    Hi,
    In this case, you can use LOOKUP. For instance,
    *LOOKUP XXX
    *DIM AAA:TIME=TIME.ACCTHRS
    *ENDLOOKUP
    *REC(EXPRESSION = %value%/LOOKUP(AAA),ACCT_PROJECT="FTE_DIRECT_BASE")
    Hope this helps.
    Regards,
    YH Seo
    ====================================================================================================
    Hi,
    Can we use dimension property value in REC statement?
    *REC(EXPRESSION = %value%/TIME.CURRENTMEMBER.PROPERTIES("ACCTHRS"),ACCT_PROJECT="FTE_DIRECT_BASE")
    WHEN I PROCESS THE SCRIPT LOGIC I AM GETTING AN ERROR "INVALID LINE IN LOGIC SECTION: *REC........"
    THANKS

  • 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

  • Problem with Script logic logs

    Hi Experts,
    I am using BPC 7.5M with SQL Server 2008, I am looking into script logic log but found one very strange statement "(More than 300,000 records. Details are not being logged)", Earlier it was not showing this statement and was showing all the entries to be posted, Is there any setting we need to do for having all the entries in the log file.
    Status log file showing as of now:
    App: HEADCOUNT - Records to be posted are 310875  (calc diff = 0)
    (More than 300,000 records. Details are not being logged)
    Time to validate records: 100.3 sec.
    Post Record Status
    Submit count : 100001
    Accept count : 100001
    Reject count : 0
    Post Record Status
    Submit count : 200002
    Accept count : 200002
    Reject count : 0
    Post Record Status
    Submit count : 300003
    Accept count : 300003
    Reject count : 0
    Post Record Status
    Submit count : 310875
    Accept count : 310875
    Reject count : 0
    Posting ok
    Time to post records:325.4 sec.
    Please Advice
    Thanks & Regards,
    Rohit

    Hi Rohit,
    This is not a problem.
    If the resultant number of records is more than 300,000, then the records are not logged.
    This can be controlled by the UNLIMIT_PRINT_LOG appset parameter. By default, this is set as NO. This will allow only 300k records to be logged.
    You can set the above parameter as YES to log all the records for the execution of all logics across the appset in all applications.
    Warning:
    Of course, it will add slow down the logic execution. Logging the records will always slow down the execution. The system has to open the file and keep writing all the records in the flatfile, which is a slow process. You can increase the speed of your logics by disabling this logging completely by using the CALCULATE_DIFFERENCE statement in your script logic for each commit section. You can reduce the logic execution time by disabling this logging.
    Karthik AJ

  • Can we calculate difference of  dimension properties values in script logic

    HI
    I have 3 products, whose manufacturing process starting perod and end periods are different for three products. Now I want
    to distribute total  manufactuing cost to those periods only for each product.  how will write script logic  for this senario.
    My system is BPC nw7.5
    Mahi

    Hi,
    So, you want to find the difference between the dates and distribute the cost among them. I dont think this will be feasible using script logic. My suggestion would be use BADI. Script logic cannot do manipulation on the properties. BADI will be much easier. In addition to this, you need to think what should be the destination of the result. Every record is going to generate few records (depending on the number of months).
    Hope this helps.

  • 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

  • Use property value in *REC EXPRESSION statement

    Hi,
    How can I use the value of a property in a *REC EXPRESSION statement.
    Assuming I have a property PRIORYEAR in my TIME dimension that indicates the same period in the previous year
    Example: ID: 2009.JAN, PRIORYEAR=2008.JAN
    I want to fetch the value from the PRIORYEAR with something like:
    *REC(EXPRESSION=([TIME].PRIORYEAR),ACCOUNT="RENTASPERCSALES")
    But it won't work. I tried few other options such as
    *REC(EXPRESSION=([TIME].CurrentMember.Properties("PRIORYEAR")),ACCOUNT="RENTASPERCSALES")
    to no avail.
    Any suggestion would be greatly appreciated.
    Thanks
    Regis

    Hi Regis,
    Just checking, have you tried using 'TMVL' function in your script logic. Please check the help.sap for the usgae and some examples.
    We could use TMVL in all the following places.
    - in a 'WHEN' statment
    - in an REC expression
    - and also in a scoping statement.
    We had some issues validating the script logic with TMVL in SP04 and teh same have been resolved in SP05. You might have to write the logic and validate the logic if your BPC version has any SP related issues.
    Example:
    *WHEN TIME
    *IS TMVL(-1, 2010.DEC)
    *REC(FACTOR=1, TIME=201.DEC)
    *ENDWHEN
    we could also use TMVL with a data manager prompt value such %TIME_SET%.
    Thanks

Maybe you are looking for

  • IDVD burning

    I have a Keynote presentation with 50 slides and music that was exported to iDVD. The problem is that when I go to burn a dvd, i get the following error, "Error During Track Initialization" I am new to mac's love all the software but not if it isn't

  • Both computers want the other one to add a device

    I don't know how I did this, but I created a new sync account and now when I try to sync on either computer it wants me to go to the other computer and add a device. I've tried to start over without any success.

  • Simple setup problems with JSTL and Tomcat

    Hi all, I'm having some problems getting JSTL to work the 1st time. JSTL setup seems to be a common problem for relative newbies, but having read previous threads, I still haven't been able to solve my problem so hopefully someone can help: the jstl.

  • IPhone isn't using all pixels on the screen?

    Hi All About one month ago i finally pulled myself together and bought myself the iPhone (great phone ) however, i just looked closely at the phone today and noticed one thing. When i am looking at the border of the screen (right before the "real bla

  • VCS starter pack support SX20?

    Hi,    In Cisco VCS Starter Pack Express Deployement Guide 7.2, Appendix 3 say it support Movi/E20/Ex60/Ex90/MX200, http://www.cisco.com/en/US/docs/telepresence/infrastructure/vcs/config_guide/Cisco_VCS_Expressway_Starter_Pack_Deployment_Guide_X7-2.p