Logic script average

hi experts,
how to use syntax "avg" in logic script? or is there any way to implement the average calculation?
as example of data in 1 model:
emp01     entity01     interco01     percent     0.1
emp02     entity01     interco01     percent     0.2
emp03     entity01     interco01     percent     0.3
emp01     entity01     interco01     amount     1
emp02     enitty01     interco01     amount     1
emp03     entity01     interco01     amount     1
calculate average:
avg = sum(percent) / sum(amount)
avg = 0.6 / 3
avg = 0.2
thank you.

hi Vadim,
this average result will be stored and using as basis of other calculation. this average will show in input template with the standard calculation at backend, but user can overwrite it in input template.
percent means proportion to be allocated
amount means amount of headcount to related employee (this value always 1 for every employee)
after i get this average, this value will be used as driver to calculate cost.
additional example from above:
emp01     entity01     interco01     cost     1000
emp02     enitty01     interco01     cost     1000
emp03     entity01     interco01     cost     1000
expected average result:
no_emp     entity01     interco01     avg     0.2
record another row:
no_emp     entity01     interco01     avgcost     0.2 * 3000
i just give a simple example and want to know how to do average in logic script. is it possible to calculate average using logic script?
thank you.

Similar Messages

  • Cannot modify logic script on BPC 10.0

    Hello All,
    I need to change a simple logic in our existing logic script. I changed, validated and hit a save button. It says that "The Script Logic file has been updated". However, my change is not saved. When I open a script Logic after I saved, I see the original one only.
    I talked to BASIS team to check the PROCTIMEOUT on server and found that it has 3600. Which is two times higher than SAP recommended. There are about 200 lines in logic scripts.
    Could you please help why I can not modify the logic scripts?
    Thank you very much in advance!!!
    Thanks
    Indra

    Hi Indra,
    I dont think its related to the timeout settings of a DIA process. Could you please check if you have proper authorizations to Update the script Logic in BPC  ?
    Regards
    Ram

  • How to SIMPLY use the %DIMENSION_TO_SET% variables into logic scripts

    hello,
    I'm using a prompt of type "COPYMOVE" or "COPYMOVEINPUT". In this type of prompt, there are 2 columns of dimension members list, one for defining the "source zone" and one for defining the "target zone" of logics.
    The left colum of the prompt (for source zone) feeds the variables %DIMENSION_SET% : %ACCOUNT_SET%, %ENTITY_SET%, %CATEGORY_SET%, etc...and these variables can be used in the logic scripts in *XDIM_MEMBERSET instructions for example.
    The right colum of the prompt feeds the variables %DIMENSION_TO_SET% : %ACCOUNT_TO_SET%, %ENTITY_TO_SET%, %CATEGORY_TO_SET%, etc...and I don't know how to SIMPLY use these variables in the logic scripts.
    I've found a tricky way to do that but I meet 2 problems :
    - it is complicated
    - the multi-info instruction (BEGININFO/ENDINFO) seems to be bugged as blank lines are added all the time in the code and sometimes I have to wait for minutes when I try to modifiy the package code through BPC for excel eData/modify package menu.
    So the question is how to SIMPLY get the %DIMENSION_TO_SET% variables into logic scripts and use them ? Thanks, R.
    Here is the tricky package code I use at this time (I build one function for each %DIMENSION_TO_SET% variable and I pass these functions to the logic) :
    PROMPT(COPYMOVE,,,,"ACCDETAIL,ACCOUNT,CATEGORY,DATASRC,ENTITY,TIME,YEARS")
    TASK(Execute formulas,USER,WS-WW\PlauchuR)
    TASK(Execute formulas,APPSET,US)
    TASK(Execute formulas,APP,SV)
    TASK(Execute formulas,SELECTION,D:\BPC\Data\WebFolders\US\SV\PrivatePublications\PlauchuR\TempFiles\FROM_1561_.TMP)
    TASK(Execute formulas,TOSELECTION,D:\BPC\Data\WebFolders\US\SV\PrivatePublications\PlauchuR\TempFiles\TO_1561_.TMP)
    BEGININFO(%FSS%)
    *FUNCTION TARGETACCDETAIL=%ACCDETAIL_TO_SET%
    *FUNCTION TARGETACCOUNT=%ACCOUNT_TO_SET%
    *FUNCTION TARGETCATEGORY=%CATEGORY_TO_SET%
    *FUNCTION TARGETDATASRC=%DATASRC_TO_SET%
    *FUNCTION TARGETENTITY=%ENTITY_TO_SET%
    *FUNCTION TARGETTIME=%TIME_TO_SET%
    *FUNCTION TARGETYEARS=%YEARS_TO_SET%
    ENDINFO
    TASK(Execute formulas,FORMULASCRIPT,%FSS%)
    TASK(Execute formulas,LOGICFILE,D:\BPC\Data\WebFolders\US\SV
    ..\AdminApp\SV\_TEST.Lgf)
    TASK(Execute formulas,RUNMODE,1)
    TASK(Execute formulas,LOGICMODE,1)
    Edited by: ALEXANDRE BEDIER on Jun 16, 2010 3:15 PM

    hello,
    finally I've discovered that there is no need of BEGININFO instruction.
    One can pass several functions to a logic with one FORMULASCRIPT task. The functions definitions have to be separated by instructions. See below :
    PROMPT(COPYMOVEINPUT,%FTARGETS%,,"select source and target zone for category and datasource.","ACCDETAIL,ACCOUNT,CATEGORY,DATASRC,ENTITY,TIME,YEARS")
    TASK(Execute formulas,FORMULASCRIPT,*FUNCTION TACCDETAIL=%ACCDETAIL_TO_SET% *FUNCTION TACCOUNT=%ACCOUNT_TO_SET% *FUNCTION TCATEGORY=%CATEGORY_TO_SET% *FUNCTION TDATASRC=%DATASRC_TO_SET% *FUNCTION TENTITY=%ENTITY_TO_SET% *FUNCTION TTIME=%TIME_TO_SET% *FUNCTION TYEARS=%YEARS_TO_SET%)
    TASK(Execute formulas,USER,%USER%)
    TASK(Execute formulas,APPSET,%APPSET%)
    TASK(Execute formulas,APP,%APP%)
    TASK(Execute formulas,SELECTION,%SELECTIONFILE%)
    TASK(Execute formulas,LOGICFILE,%APPPATH%\..\AdminApp\%APP%\_TEST.LGF)
    TASK(Execute formulas,RUNMODE,1)
    TASK(Execute formulas,LOGICMODE,1)
    Then one will be able to use the functions TACCDETAIL, TCATEGORY, TACCOUNT,... in the logic script.
    Edited by: ALEXANDRE BEDIER on Jun 24, 2010 10:31 AM
    Edited by: ALEXANDRE BEDIER on Jun 24, 2010 10:33 AM

  • Lookup total value in logic script

    hi experts,
    is it possible to lookup with same criteria that returns many row and fetch the total of all returning rows ? if it is possible, how ?
    you can see at attached picture, i try to lookup with same criteria (row 3 & row 5), the different only at column 3. what i want is fetch the total value of row 3 & row 5 = 1000 + 10000 = 11000
    but what i get is 1000 which means only fetch the first row (row 3).
    the code that i using in my logic script:
    *XDIM_MEMBERSET ACCOUNT = 551010
    *XDIM_MEMBERSET METRIC = PERCENTAGE
    *XDIM_MEMBERSET RPTCURRENCY = LC
    *XDIM_MEMBERSET SUBITEM1 = NO_SUB1
    *XDIM_MEMBERSET MEASURES = PERIODIC
    *XDIM_MEMBERSET SUBITEM3 = NO_SUB3
    *XDIM_MEMBERSET BUAREA = NO_BUAREA
    *XDIM_MEMBERSET ENTITY = %ENTITY_SET%
    *XDIM_MEMBERSET CATEGORY = 2014Q3
    *XDIM_MEMBERSET AUDITTRAIL = Input, OFFSET
    *XDIM_MEMBERSET INTERCO <> NO_INTERCO
    *XDIM_MEMBERSET TIME = 2014.07
    *LOOKUP Finance
    *DIM EXP_Input:AUDITTRAIL = Input
    *DIM EXP_Input:METRIC = AMOUNT
    *ENDLOOKUP
    thank you.

    Hi Yoki,
    Please, read How To: Ask questions about Script Logic issues
    Point 9! and other...
    In general it's possible to use LOOKUP to get a value of the parent node, but it's not clear what total do you want to get.
    Vadim

  • Passing variables from DM to logic script problem (REPLACEPARAM)

    Dear All,
    I would like to send variables from data manager to a logic script. The script copies values from an account to an other. If I hardcode two accounts in the script, it works fine, but I want to pass these two accounts dynamically from data manager to the script.
    My advanced script in DM looks as follows:
    PROMPT(SELECTINPUT,%ENTITY_M%,,"Select entity:","ENTITY_DIM")
    PROMPT(SELECTINPUT,%SOURCE%,,"Select source account:","ACCOUNT_DIM")
    PROMPT(SELECTINPUT,%TARGET%,,"Select target account:","ACCOUNT_DIM")
    INFO(%EQU%,=)
    INFO(%TAB%,;)
    TASK(PROCESS_CHAIN_RUNL,TAB,%TAB%)
    TASK(PROCESS_CHAIN_RUNL,EQU,%EQU%)
    TASK(PROCESS_CHAIN_RUNL,SUSER,%USER%)
    TASK(PROCESS_CHAIN_RUNL,SAPPSET,%APPSET%)
    TASK(PROCESS_CHAIN_RUNL,SAPP,%APP%)
    TASK(PROCESS_CHAIN_RUNL,SELECTION,%ENTITY_M%)
    TASK(PROCESS_CHAIN_RUNL,LOGICFILENAME,ACCOUNT_COPY_LOGIC.LGF)
    TASK(PROCESS_CHAIN_RUNL,MEMBERSELECTION,SOURCE%EQU%%SOURCE%%TAB% TARGET%EQU%%TARGET%)
    In the logic script, I'm using $SOURCE$ and $TARGET$ as variables, but it seems that only the first of them gets the value from DM, the other one not, and I always get an error message:
        Member "$TARGET$" not exist
    The second variable doesn't seem to get the value. If I use only one variable, either SOURCE or TARGET, it works fine...
    ...and I also tried to replace the MEMBERSELECTION statement with a REPLACEPARAM statement:
    TASK(PROCESS_CHAIN_RUNL,REPLACEPARAM,SOURCE%EQU%%SOURCE%%TAB% TARGET%EQU%%TARGET%)
    This way I got an other error message, saying: "Member .../PrivatePublications/user not exist"
    Do you have any idea? How to pass two user selected parameters to a logic script?
    Thanks for your help,
    A.

    Hi CsernusAttila
    You cannot use ACCOUNT_DIM with promp SELECT  and variable $SOURCE$ because it only works with variable ACCOUNT_SET in your script logic.
    instead of you can use TEXT
    PROMPT(TEXT,%,ENTITY_M%%,"Select Entity",)
    PROMPT(TEXT,%,SOURCE%%,"Select Source",)
    PROMPT(TEXT,%,TARGET%%,"Select Target",)
    INFO(%EQU%,=)
    INFO(%TAB%,;)
    TASK(PROCESS_CHAIN_RUNL,TAB,%TAB%)
    TASK(PROCESS_CHAIN_RUNL,EQU,%EQU%)
    TASK(PROCESS_CHAIN_RUNL,SUSER,%USER%)
    TASK(PROCESS_CHAIN_RUNL,SAPPSET,%APPSET%)
    TASK(PROCESS_CHAIN_RUNL,SAPP,%APP%)
    TASK(PROCESS_CHAIN_RUNL,SELECTION,%SELECTION%)
    TASK(PROCESS_CHAIN_RUNL,LOGICFILENAME,ACCOUNT_COPY_LOGIC.LGF)
    TASK(PROCESS_CHAIN_RUNL,REPLACEPARAM,SOURCE%EQU%%SOURCE%%TAB% TARGET%EQU%%TARGET%)
    or you can modify your script like this
    *XDIM_MEMBERSET ACCOUNT=%ACCOUNT_SET%
    *XDIM_MEMBERSET ENTITY=%ENTITY_SET%
    And your Prompt like this
    PROMPT(SELECTINPUT,,,,"%ACCOUNT_DIM%,%ENTITY_DIM%,")
    TASK(PROCESS_CHAIN_RUNL,TAB,%TAB%)
    TASK(PROCESS_CHAIN_RUNL,EQU,%EQU%)
    TASK(PROCESS_CHAIN_RUNL,SUSER,%USER%)
    TASK(PROCESS_CHAIN_RUNL,SAPPSET,%APPSET%)
    TASK(PROCESS_CHAIN_RUNL,SAPP,%APP%)
    TASK(PROCESS_CHAIN_RUNL,SELECTION,%SELECTION%)
    TASK(PROCESS_CHAIN_RUNL,LOGICFILENAME,ACCOUNT_COPY_LOGIC.LGF
    I hope it helps
    Regards!!

  • MDX in logic script

    Dear All,
    How can I use MDX in logic scripts?
    For example, I would like to use the function IIF(...), but the system doesn't want to recognise it as a valid keyword. Even if I nest it in a REC statement as an expression, it doesnt work. Do you have any idea?
    Thanks for your help in advance,
    A.

    Hi Ergin,
    I can understand your approach not to use ABAP hence you miss the skills witin your project team.
    However, you (or you client) has chosen the NetWeaver version for whatever reason. I'm sure a thorough decisions process has lead to this decision. In choosing the NetWeaver version with SAP BI you will sooner or later come to the point that you will have to use ABAP if you like it or not. Especially when you start using further capabilities within NetWeaver and the BI solutions. So from my point of view ABAP knowledge is an essential skill you need in a project based on SAP NetWeaver anyway.
    Additionally I heared some statements that MDX is causing some performance issues on the NetWeaver version. This may have been fixed in the meantime with some SPs.
    As the SQL within the NetWeaver verison does not have the full functionality than it has in MS Version SQL is not an option for me.
    I do also not see the cost impact hence someone need to do the support anyway. In case of MDX you need an MDX developer, in case of ABAP and ABAP developer. Or a technical BPC consultant able to do the development (which I would recommend you should have in your project team anyway).
    So coming back to your original question, I would recommend to do as much as possible using ABAP BADIs.
    Cheers,
    Steffen

  • Logic Script Error - 42

    Hello Friends,
    I am facing the logic script error when validating the script. "the script is apparently invalid, as you cannot have member "". The logic is run for grouped cost center.
    Logic Script:
    //***********************START OF HEADER*****************
    //SUB QUERY:
    //PURPOSE:      Copy high Level forecast data from Actuals, Budget, commitments to base level cost centres defined for forecat
    //CALLED FROM:  Data Manager Package
    //WHO:          Matt Penston (itelligence)
    //VERSION:      1
    //DATE:         26-11-2012
    //CHANGE LOG:
    //***********************END OF HEADER********************
    //********************** Need to first of all clear down the BW data in the base member costcentres ***************
    // Set XDIM_MEMBERSET
    *XDIM_MEMBERSET CATEGORY = Actual,Budget,COMMITMENTS
    *XDIM_MEMBERSET AUDITTRAIL = BW
    *XDIM_MEMBERSET ACCOUNT = <ALL>
    *XDIM_MEMBERSET RPTCURRENCY = LC
    *XDIM_MEMBERSET ACCDETAIL = F_None
    //Select Current Month Time Member to copy from
    //*SELECT(%TIME_CURRMTH_FYA%,"[ID]","TIME","[FCST_PROFILES] = 'A'")
    //*XDIM_MEMBERSET TIME = %TIME_CURRMTH_FYA%
    *XDIM_MEMBERSET TIME = BAS(201314.TOTAL)//CHANGE ONCE PER YEAR
    //Select CostCentres for high level Forecast entry
    //*SELECT(%HL_FCST_ENT%,"[ID]",COSTCENTRE,"[HL_FCST_ENT] = 'Y'")
    // Use For Loop to run through the Cost Centres
    //*FOR %HL_FCST_FOR% = %COSTCENTRE_SET%
    *XDIM_MEMBERSET COSTCENTRE  = BAS(%COSTCENTRE_SET%)
    //*SELECT(%HL_FCST_BASE%, "[ID]", COSTCENTRE, "[HL_FCST_PRNT] = %COSTCENTRE_SET%")
    *SELECT(%HL_FCST_BASE%, "[HL_FCST_BM]", COSTCENTRE, "[ID]= %COSTCENTRE_SET%")
    // Set the Ref Data to Transaction, is the default but defined anyway.
    *WHEN_REF_DATA=TRANSACTION_DATA
    *WHEN CATEGORY
    *IS *
    *REC(FACTOR=-1, AUDITTRAIL = BW_HL, COSTCENTRE = %HL_FCST_BASE%)
    *REC(FACTOR=1, AUDITTRAIL = BW, COSTCENTRE = %HL_FCST_BASE%)
    *ENDWHEN
    //*NEXT
    *COMMIT
    The Error Came once validate above script:
    Can anyone please guide the same.
    Regards,
    Dev.

    Hello Vadim,
    As you guided above mail yes, I have put the Data Region: "COSTCENTRE=YPROG" and the below script is copied in Script File Location:
    *XDIM_MEMBERSET CATEGORY = Actual,Budget,COMMITMENTS
    *XDIM_MEMBERSET AUDITTRAIL = BW
    *XDIM_MEMBERSET ACCOUNT = <ALL>
    *XDIM_MEMBERSET RPTCURRENCY = LC
    *XDIM_MEMBERSET ACCDETAIL = F_None
    //Select Current Month Time Member to copy from
    *XDIM_MEMBERSET TIME = BAS(201314.TOTAL)//CHANGE ONCE PER YEAR
    *XDIM_MEMBERSET COSTCENTRE  = BAS(%COSTCENTRE_SET%)
    *SELECT(%HL_FCST_BASE%, "[HL_FCST_BM]", COSTCENTRE, "[ID]= %COSTCENTRE_SET%")
    // Set the Ref Data to Transaction, is the default but defined anyway.
    *WHEN_REF_DATA=TRANSACTION_DATA
    *WHEN CATEGORY
    *IS *
    *REC(FACTOR=-1, AUDITTRAIL = BW_HL, COSTCENTRE = %HL_FCST_BASE%)
    *REC(FACTOR=1, AUDITTRAIL = BW, COSTCENTRE = %HL_FCST_BASE%)
    *ENDWHEN
    //*NEXT
    *COMMIT
    and the Log is given : UJK_VALIDATION_EXCEPTION:Member "" not exist
    Please let me know were is the problem.
    My findings:
    After checking the Category Dimension come to know that the member dimension is maintained with 201213.TOTAL and in script logic we are using the 201314.TOTAL.
    Can you please let me know what is the issue in the script logic.
    Regards,
    Rajesh. K

  • Inventory movement using logic script - BPC NW 10

    Hello BPC experts,
    I'm working on inventory movement using logic script. The idea is that the initial stock of the first period equals the final stock of the previous period.
    Here is an example of my inventory report : (Dimension INVT in function of dimension TIME)
                                                  2014.01       2014.02      2014.03        2014.04
    F01 Stock first period                  12            
    F02 Initial Stock                          12                 11              10                 9
    F03 Inventory Inputs                    2                   4                6                   8
    F04 Inventory Outputs                 3                   5                7                   9
    F05 Final Stock                          11                 10               9                   8
    The Stock of the first period is entered
    The initial Stock = Stock first period (12 in our case)
    Inventory inputs and Outputs are entered
    Final Stock = Initial Stock + Inventory Inputs - Inventory Outputs
    I tried the following script but it does not work :
    *XDIM_MEMBERSET TIME = 2014.01 //we should then retrieve the first period of each year which is not necessary the first month of the year
    *WHEN TIME
    *IS 2014.01
    *REC(EXPRESSION = [INVT].[F01], INVT = F02)
    *ENDWHEN
    *SELECT(%TIME_LIST%,"[ID]","TIME","[PREVMEMBER]"<>"") // PREVMEMBER is a property of TIME
    *XDIM_MEMBERSET TIME = %TIME_LIST%
    *XDIM_MEMBERSET INV = F05
    *WHEN TIME
    *IS %TIME_LIST%
    //Something is missing here.. How to retrieve F05 values related to all periods and copy them in F02
    *REC(EXPRESSION =[INVT].[F05],INVT = F02)
    *ENDWHEN
    Please how can I achieve this ?
    Thanks
    Maha

    Hi Vadim,
    Thank you for your reply
    I'm working with BPC NW 10 SP 05 (CPMBPC 801 SP 05), Engine ABAP
    My model contains the following dimensions ACCOUNT (A), TIME (T), CATEGORY (C), ENTITY (E), CURRENCY (R), INVT (User Def)
    In the INVT dimension we have members like (Stock first period, Initial Stock, Inventory Inputs, Inventory Outputs, Final Stock)
    - [INVT].[Stock first period] is entered
    - [INVT].[Initial Stock] = [INV].[Stock first period]
    - [INVT].[Inventory input] and [INVT].[Outputs] are entered
    - [INVT].[Final Stock] = [INVT].[Initial Stock] + [INVT].[Inventory Inputs] - [INVT].[Inventory Outputs]
    We want to calculate Initial Stock in DEFAULT.lgf :
    [INVT].[Initial Stock] when (TIME=2014.01) = [INVT].[Stock First Period] when (TIME= 2014.01)
    [INVT].[Initial Stock] when (TIME=2014.02) = [INVT].[Final Stock] when (TIME= 2014.01)
    [INVT].[Initial Stock] when (TIME=2014.03) = [INVT].[Final Stock]  when (TIME=2014.02)
    [INVT].[Initial Stock] when (TIME=2014.04) = [INVT].[Final Stock]  when (TIME=2014.03)
    When a user enters the values of "Stock first period", "Inventory Inputs" and "Inventory Outputs", Initial Stock and Final stock should be calculated via logic script
    Regards
    Maha

  • Logic script considering comments

    Hi everybody,
    I would like to know wether is it possible to generate a logic script which is able to obtain a comment associated to a dimensional point of the cube. Then it should use the comment to look for a member of a different dimension with the ID equals to the comment. Then, I want to copy a transactional value associated to this ID in the previous dimensional point from which we got the comment.
    Firstly, I would like to know if it is feasible to do? Then, in case it is, I would start thinking how to really implement it.
    Any help will be appreciated,
    Regards,
    Antonio

    Many Thanks Sheldon,
    I discart using comments to develop the logic. However, do you know if is possible to get in a variable the value of a property of a dimension member? it would be very usefull since it would solve the problem we have in the new solution we have proposed for the logic script.
    Regards,
    Antonio

  • Logic Script (Copying records while save from input screen)

    Hi Gurus,
    How to handle below requirement in script logic:
    Input screen column = Time (5 years)
    User want to input forecast data in current year and same data should be copied over to rest of the 4 years.
    I am new to Logic Script!
    Thanks.

    Another option is to add 4 properties to TIME dimension: SHIFT1,SHIFT2,SHIFT3 and SHIFT4 and fill them with members:
    2014.01 -> 2015.01 2016.01 2017.01 2018.01
    2014.02 -> 2015.02 2016.02 2017.02 2018.02
    ... etc
    Some maintenance work...
    The code will be simple and without FOR/NEXT loop:
    *WHEN CATEGORY
    *IS FORECAST
    *REC(EXPRESSION=%VALUE%,TIME=TIME.SHIFT1)
    *REC(EXPRESSION=%VALUE%,TIME=TIME.SHIFT2)
    *REC(EXPRESSION=%VALUE%,TIME=TIME.SHIFT3)
    *REC(EXPRESSION=%VALUE%,TIME=TIME.SHIFT4)
    *ENDWHEN
    Vadim

  • BPC Security - Edit Logic Script

    Trying to find the security task that give edit access to Logic Script(BPC 10 NW SP9). Is this combined with the "Edit Packages" Data Manger task?
    Thank you.
    Regards,
    Vinod Swarnapuri

    Vinod,
    I think the one you are looking for is Manage Business Rules.
    Akos

  • Compound boolean logic scripting

    Greetings!  I would like to pick everyone's brains for how one might implement compound boolean logic scripting in LabVIEW ... specifically LabVIEW-RT.
    My application is an in-vehicle data acquistion and logging setup.  The app is setup so that the user provides a configuration file which is the list of channels (GPS, DAQ, CAN) that they wish to record...so this means there isn't any hard coded variable but an array of clusters built from the configuration file.
    A mode of operation is a 'trigger' mode, which means the logger doesn't record anything until a trigger has occured.  Currently the user provides a simple comparator (0=lessthan, 1=equalto, 2=greaterthan, else=none), and the trigger value.
    The users want to be able do compound conditions like PARAMETER <= x OR Parameter >= y ... possiblly even between 2 different data points like PARAMETER_A <= x AND PARAMETER_B >=y.
    Any comment, hints, tips, suggestions ?
    Thanks!
    Jason Stallard

    Jason,
    It's interesting how often the problem of text-based scripting to drive LV pops up.
    I had a problem with similar properties: given a set of data and an
    arbitrary set of rules, substitute data into each rule and see if it
    evaluates to true or false.  This is used to provide directions
    from engineers to operators on how to perform failure analysis and
    recovery, without the engineer needing to be present.
    The problem that I ran into turns out to not be in evaluating the data
    and rules, but in parsing the arbitrary input equation.  There
    just isn't any general way inherent to LV to parse an arbitrary text
    language into an intermediate form (like a postfix expression or an
    abstract syntax tree).  A relative lack of recursion makes it a
    little more painful as well.
    I can't release my code, but it essentially had three parts:
    1.  In a given rule in infix form (variableA<7, for instance),
    perform macro replacement.  Essentially, substitute values for
    variable names, perform file lookups, etc.
    2.  Transform the substituted infix equation into a much easier to
    deal with postfix equation.  (Thanks to Mike Porter for this
    suggestion as well).  This step can be non-trivial.  I'm
    currently building an editor that will build equations more easily,
    sparing my engineers much pain.
    3.  Evaluate the postfix equation for a single true/false
    result.  This algorithm should be available in many books, but I
    adapted the one from an earlier version of this book:
    http://www.amazon.com/gp/product/0201702975/qid=11​37608429/sr=2-3/ref=pd_bbs_b_2_3/103-3337903-13870​46?s=books&v=glance&n=283155
    It also contains a short description of a stack-based parser that's fairly easy to implement for step 2.
    Anyway, there's my 2 cents.  Maybe someday I'll find time to write
    that LV based parser generator to "simplify" all of this   Good
    luck!
    Joe Z.

  • Logic script:

    Hi everybody,
    Is it possible in a logic script to get the record saved for a member I_123456 and save it in a member of another dimension which is equal to the 6 right caracters of the first ID: I_123456  ---> 123456
    Many thanks in advance,
    Antonio

    Hi,
    From your example, it looks like I_123456 is from Intco dimension and 123456 is from entity dimension. I will take it as example. Your code should be something like:
    *WHEN INTCO
    *IS I_123456
       *REC(ENTITY = 123456)
    *ENDWHEN
    In the above code "ENTITY = 123456" is fixed. We can make it dynamic by maintaining it as a property of the Intco dimension. In that case, the code will be like:
    *WHEN INTCO
    *IS I_123456
       *REC(ENTITY = INTCO.ENTITY)
    *ENDWHEN
    Still, the statement "*IS I_123456" is fixed. The logic is running for only I_123456. You need to generalize it as per the requirement.
    The above code will just create another record with entity as 123456. The original record, however, is not deleted.
    Hope this helps.

  • Error while saving logic script

    Hello Everybody,
    From this morning we are having this message:
    Unhandled Error (HTTP Status:500): unmarshal.invalid.xml
    While trying to saving logic scripts.
    Anyone know the solution?
    Have tried the sap notes in the other threads but they don't seem to work.
    Got BPC 10 and installed recently the SP5
    thanks for help

    We have gone through the below SAP notes already but no luck!
    http://service.sap.com/sap/support/notes/1693703
    http://service.sap.com/sap/support/notes/1649819
    -Srujana

  • Logic script invalid function mid()

    Hi Expert
    Can i use mid() function in the logic script like:
    *Rec(FACTOR=1,Location=mid(ENTITY.Loc,3,20))
    I do try, but it store  "mid(ENTITY.Loc,3,20)" to my database.
    any idea how to achieve this.
    Thanks.

    Hi Guik,
    I think the best way to achieve this would be by following these steps:
    1. Add an additional property to your Entity dimension which would contain the value of the MID function. This would be there for all ID's
    2. In your script logic you would need to use the Lookup function that would be able to lookup this property using the actual ID
    Hope this helps!
    Santosh

Maybe you are looking for