Distribution in script logic

Hello, all.
I'm new in BPC. Please give advice, how can we realize following logic.
We have a application Sales with following dimensions.
Account, Category, DataSrc, Entity, Department, Prodline, RptCurrency, Time
User send data to the DB in view:
Account | Category | DataSrc | Entity | Department | Prodline | RptCurrency| Time
NetSales | BUDGET | Input | Company_In | Sales | NoProd | LC | 2008.INP
Where each record NetSales, Budget, etc has no child
and user send data in view:
Account | Category | DataSrc | Entity | Department | Prodline | RptCurrency| Time
Coeficient | BUDGET | Input | Company | Sales | NoProd | LC | 2008.INP
Where Entity has 3 childs: Company_1, Company_2, Company_3.
After posting a data to Fact table, it view, is:
Account | Category | DataSrc | Entity | Department | Prodline | RptCurrency| Time | Signed_data
NetSales | BUDGET | Input | Company_In | Sales | NoProd | LC |2008.INP| -20
Coeficient| BUDGET | Input | Company_1 | Sales | NoProd | LC | 2008.INP| -0,1
Coeficient| BUDGET | Input | Company_2 | Sales | NoProd | LC | 2008.INP| -0,3
Coeficient| BUDGET | Input | Company_3 | Sales | NoProd | LC | 2008.INP| -0,6
I want to get new records in db such as:
Account | Category | DataSrc | Entity | Department | Prodline | RptCurrency| Time | Signed_data
NetSales | BUDGET | Input | Company_1 | Sales | NoProd | LC | 2008.INP| -2
NetSales | BUDGET | Input | Company_2 | Sales | NoProd | LC | 2008.INP| -6
NetSales | BUDGET | Input | Company_3 | Sales | NoProd | LC | 2008.INP| -12
Where NetSales distribute by coefficient for each Entity.
I want do something like (Account ="NetSales",Entity ="Company_1")= (Account="NetSales",Entity="Company_In")*(Account="Coeficient",Entity.Company_1) for each Company_n.
How can I write script logic for this.
Thanks

I think there are several options.  The easiest option may be simply to construct a template that sends the values directly based on the input of the Coefficients and the Raw data value input of 20.  Thus the input process would submit 7 total entries.
Now should you wish to have a repeatable calculation process that updates the Child entities each time either a coefficient or data input point is submit, then you could utilize script logic that was suggested in the thread as an allocation process. Otherwise, you would need to develop sets of properties and script logic for each set of requests such as:
*When Account.ID
*IS COEFFICIENT
*WHEN ENTITY.ID
*IS COMPANY_1
*REC(EXPRESSION = VALUE * GET(ACCOUNT=ACCOUNT.NETSALES,ENTITY=ENTITY.COMPANY_IN), ACCOUNT=ACCOUNT.NETSALES)
*ENDWHEN
*ENDWHEN
*COMMIT
This is not as flexible and there are many approaches that may be taken here, such as using LOOKUP statements and proeprties to manage the calculations and make them more flexible. It will just depend on how much volume there is to calculate, how many statements are required and how often the logic will need to be updated or managed based on hierarchy changes to the entity dimension.  Plus, you need to test many options to determine which is the fastest approach during the send process.
Hope this helps.

Similar Messages

  • 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

  • Use of LEFT in Script Logic

    I am having one doubt reagrding usage of excel function like LEFT, MID, RIGHT in script logic of SELECT Statement.
    Let me know with example if its possible.
    I tried the below statement:
    *SELECT(%EQACC%,"ID","ACCOUNT","LEFT(ID,6)='BE9001' AND CALC='N' AND ID<>'BE9001010'")
    But it throw the error as "invalid select statement"
    Anurodh

    Anurodh,
    what you are trying to do is not supported. As a workaround you can try to create a new property in the dimension (for example IDSHORT), putting in this filed just the first 6 characters of the ID and you can filter on it like in the following example:
    *SELECT(%EQACC%,"ID","P_ACCT","IDSHORT='CE0004' AND CALC='N'")
    Regards,
    Simmaco

  • Greater Than Function in Script Logic File

    BPC Experts,
    I've got a pretty simple script logic file to calculate salary amounts, overtime, etc.  The purpose of this logic is for forecasting.  I have two referenced dimensions, TIME and SCENARIO, where TIME.MONTHNUM is equal to its relative month number (eg: Jan monthnum = 1), and SCENARIO.CURRMONTH is equal to the relative amount of actual months data, (eg Jan currmonth = 0, Feb = 1) because if you are completing a February forecast, you have one month of actual.
    The ACTUAL scenario is never touched, but after a month closes, we copy the ACTUAL data to, for example, FEB_FCST.  So, after January closes, its actuals are copied to the FEB_FCST scenario so we can complete an actual/forecast (one month actual, 11 months forecast).
    Currently, the default logic skips anything in the ACTUAL scenario, by stating "*WHEN SCENARIO, *IS <> "ACTUAL" yada yada yada.
    However, when the default logic runs on the forecast scenarios, it takes the same inputs from the months that are copied over from the ACTUAL scenario and adds to the original amount, essentially doubling the value--ultimately causing an incorrect actuals number in the forecast scenario.
    My script right now looks like this:
    *XDIM_MEMBERSET DATASRC=INPUT
    *XDIM_MEMBERSET PRODUCT=NO_PRODUCT
    *XDIM_MEMBERSET SHIFT=NO_SHIFTS
    *XDIM_MEMBERSET MEASURES=PERIODIC
    *WHEN SCENARIO
    *IS <> "ACTUAL"
         *WHEN TIME.MONTHNUM
         *IS > SCENARIO.CURRENTMNTH
              *WHEN ACCOUNT
              *IS "SALARIED_MANPOWER"
                   *REC(EXPRESSION=((([ACCOUNT].[SALARIED_AVG_WAGE] * (1 + [ACCOUNT].[SALARY_TIMEAHALF]))* [ACCOUNT].[SALARIED_MANPOWER])),ACCOUNT="01100")
              *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    When it hits line 9 (*IS > SCENARIO.CURRENTMNTH) during validation, it errors.  How can I use a "greater than" function to dictate whether or not a given scenario should run default logic on a specific month?
    If not, is there a different/better way to do it?
    Thank you!
    ABF

    Hi Alex
    Take this sample logic, check the properties in your Time dimension to trouble shoot your issue.
    *SELECT(%CAT_VAR%, "ID", CATEGORY, ID= PLAN_APRIL)
    *XDIM_MEMBERSET CATEGORY = ACTUAL, PLAN, %CAT_VAR%
    *SELECT(%CATMTH%, "STARTMTH", CATEGORY, ID= %CAT_VAR%)
    *SELECT(%ACT_PERIOD%, "ID", TIME, MONTHNUM < %CATMTH% AND  LEVEL = MONTH AND YEAR = 2010)
    *SELECT(%PLAN_PERIOD%, "ID", TIME, MONTHNUM >= %CATMTH% AND LEVEL = MONTH AND YEAR = 2010)
    *XDIM_MEMBERSET TIME= %ACT_PERIOD%
    *XDIM_MEMBERSET CATEGORY=ACTUAL
    *WHEN CATEGORY
    *IS ACTUAL
    *REC(EXPRESSION=%VALUE%, CATEGORY = %CAT_VAR%)
    *ENDWHEN
    *XDIM_MEMBERSET TIME= %PLAN_PERIOD%
    *XDIM_MEMBERSET CATEGORY=PLAN
    *WHEN CATEGORY
    *IS PLAN
    *REC(EXPRESSION=%VALUE%, CATEGORY = %CAT_VAR%)
    *ENDWHEN
    Thanks

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

  • How to copy applications using script logic with conditions

    Hi,
    I have two copy data between application A to application B, but only i want to copy the March's Data of Application A. Dimensions are the same in both applications
    I'm going to use this script logic, ¿this script will work?
    *WHEN TIME
    *IS "2009.MAR"
    *DESTINATION_APP=B
    Thanks in advance
    Regards,
    Juan

    Hi all,
    Finally I solved the issue, the problem was that i haven't add this line in the script logic:
    TASK(Execute formulas,USER,%USER%)
    But now i need to pass in the script logic as an input: entity and time. Below is the code I prepare, it has no error but it doesn't work. ¿any idea?
    Thanks in advance
    Regards,
    Juan
    *SSIS PACKAGE *
    'DEBUG(ON)
    PROMPT(RADIOBUTTON,%CHECKLCK%,"Select whether to check work status settings when running logic.",1,{"Yes, check for work status settings before running logic","No, do not check work status settings"},{"1","0"})
    PROMPT(SELECTINPUT,,,"Please select entity and time to copy data from LegalAppNceu to LegalApp",%ENTITY_DIM%%TIME_DIM%)
    TASK(Execute formulas,USER,%USER%)
    TASK(Execute formulas,APPSET,%APPSET%)
    TASK(Execute formulas,APP,%APP%)
    TASK(Execute formulas,LOGICFILE,%APPPATH%..AdminApp%APP%CopyApplication.lgx)TASKTASK(Execute formulas,RUNMODE,1)
    TASK(Execute formulas,LOGICMODE,1)
    TASK(Execute formulas,CHECKLCK,%CHEKCLCK%)
    SCRIPTLOGIC
    *DESTINATION_APP=LEGALAPP
    *SKIP_DIM= COSTCENTER
    *WHEN ENTITY
    *IS "%ENTITY_DIM%"
    *WHEN TIME_DIM
    *IS "%TIME_DIM%"
    *REC(FACTOR=1)
    *ENDWHEN
    *ENDWHEN
    *COMMIT

  • How to use the current view in script logic - %DIMENSIONNAME_SET% not work

    Hello,
    I have the requirement to use the values from the current view in the script logic. User would like to use the members which were selected from the current view in the calculation.
    We are using SAP BPC 7.0 SP06
    I have prepared the following scrpit:
    *XDIM_MEMBERSET TIME=$YEARS001$.NA
    *XDIM_MEMBERSET ACCOUNT=BAS(PLVEH_EXP)
    *SELECT(%CBU%,ID,BUSINESSAREA,[ID]='%BUSINESSAREA_SET%'")
    *SELECT(%CIO%,ID,INTERNALORDER,[ID]='%INTERNALORDER_SET%'")
    *RUNALLOCATION
    *FACTOR=USING
    *DIM BUSINESSAREA WHAT=BANA;WHERE=%CBU%;USING=<<<
    *DIM INTERNALORDER WHAT=IONA;WHERE=%CIO%;USING=<<<
    *DIM INDICATORS WHAT=INVEHPRI;WHERE=INPXQ;USING=INVEHQUA
    *ENDALLOCATION
    I have read in the sdn that it is possible to get the current values using %DIMENSIONNAME_SET% variable and use it but it returns all the members that were selected in the datapackage.
    I would like to know if there is any special consideration regarging the use of variable or if there is another way to solve it.
    Thanks in advance.

    Hi,
    If you want the code to be executed for the current view selected, you can place the code in Default logic which executes the logic for what ever current view values you send the data through Input schedule.
    The key word you have mentined is for script running through Data Manager which gets the value selected through user promt.
    Hope this helps,
    Regards,
    G.Vijaya Kumar.

  • FOR loop in script logic

    Dear Gurus,
    This is the logic I am working with:
    *FOR %MONTH% = 2008.FEB,2008.MAR,2008.APR,2008.MAY,2008.JUN,2008.JUL,2008.AUG,2008.SEP
    //CHECK IF THE VALUE OF THE ACCUMULATED DEPRECIATION IS GREATER THAN THE CAPITALIZED ASSET VALUE//
    [ACCOUNT].[#AccumDepr] = (([ACCOUNT].[AccumDepr]+[ACCOUNT].[Depreciation])>[ACCOUNT].[EQUIPMENT1]? [ACCOUNT].[EQUIPMENT1] : ([ACCOUNT].[AccumDepr]+[ACCOUNT].[Depreciation]))
    *NEXT
    I am trying to execute the above script logic, but the system is throwing an error that says 
    "Duplicate formula found:  [ACCOUNT].[#AccumDepr] = (([ACCOUNT].[AccumDepr]+......."
    Any idea why this is happening?
    Also, could you please suggest a better way of writing the above code?
    Thanks,
    Vijay.

    As a testing scenario, I have calculated the depreciation in a different part of the same logic.  Here it is:
    //This logic calculates the accumulated depreciation amount for the time period specified in the logic
    //NOTE:  This logic is not very dynamic and is only valid for the accounts specified in the logic
    //A FUTURE ENHANCEMENT TO THIS LOGIC WOULD BE TO MAKE THE "LIFE" OF THE ASSET A $DATAMANAGER VARIABLE$
    //AND WRITE A CUSTOM SCRIPT LOGIC
    //BEGIN SCRIPT LOGIC FILE//
    //CONSTANTS
    *XDIM_MEMBERSET CATEGORY=ACTUAL
    *XDIM_MEMBERSET ACCOUNT=Depreciation,AccumDepr,NBV_EQUIPMENT1,EQUIPMENT1
    *XDIM_MEMBERSET ENTITY=STORE1
    *XDIM_MEMBERSET TIME=2008.JAN,2008.FEB,2008.MAR,2008.APR,2008.MAY,2008.JUN,2008.JUL,2008.AUG,2008.SEP
    //BEGIN: POPULATE NET BOOK VALUE FROM CAPITALIZED ASSET VALUE //
    *WHEN ACCOUNT
    *IS EQUIPMENT1
         *WHEN TIME
         *IS 2008.JAN
              *REC(FACTOR=1,ACCOUNT="NBV_EQUIPMENT1")
         *ENDWHEN
    *ENDWHEN
    *COMMIT
    //END: POPULATE NET BOOK VALUE FROM CAPITALIZED ASSET VALUE   //
    //BEGIN: CALCULATE DEPRECIATION //
    *WHEN ACCOUNT
    *IS EQUIPMENT1
         *REC(EXPRESSION=(%VALUE%/6),ACCOUNT="Depreciation")
    *ENDWHEN
    *COMMIT
    //END: CALCULATE DEPRECIATION   //
    //BEGIN: CALCULATE ACCUMULATED DEPRECIATION AND NET BOOK VALUE //
    *FOR %MONTH% = 2008.FEB,2008.MAR,2008.APR,2008.MAY,2008.JUN,2008.JUL,2008.AUG,2008.SEP
    //CHECK IF THE VALUE OF THE ACCUMULATED DEPRECIATION IS GREATER THAN THE CAPITALIZED ASSET VALUE//
    *WHEN CATEGORY
    *IS ACTUAL
    *REC(EXPRESSION=IIF((([ACCOUNT].[AccumDepr] + [ACCOUNT].[Depreciation])>[ACCOUNT].[EQUIPMENT1]), [ACCOUNT].[EQUIPMENT1], [ACCOUNT].[AccumDepr]+[ACCOUNT].[Depreciation]))
    *ENDWHEN
    *NEXT
    //*FOR %MONTH% = 2008.FEB,2008.MAR,2008.APR,2008.MAY,2008.JUN,2008.JUL,2008.AUG,2008.SEP
    //CHECK IF THE NET BOOK VALUE OF THE ASSET IS LESS THAN ZERO//
    //*[ACCOUNT].[#NBV_EQUIPMENT1] = (([ACCOUNT].[NBV_EQUIPMENT1]-[ACCOUNT].[Depreciation])>0? ([ACCOUNT].[NBV_EQUIPMENT1]-[ACCOUNT].[Depreciation]) : 0)
    //*NEXT
    *COMMIT
    //END: CALCULATE ACCUMULATED DEPRECIATION AND NET BOOK VALUE   //
    //END SCRIPT LOGIC FILE//
    Please let me know if there is a better way to write this code.
    Thanks for all your help.

  • Raise an ERROR message from Script logic

    Hi All
    Here i have developed a custom copy funtion im not using standard copy functionality.
    I am trying to copy from working version to another version ex: V01 to V02. I have scoped these two versoins in script logic.
    But when user runs DM package for a different version other than v01 and v02 then user has to get the error message.
    Can i achive this by including some code in the script logic. i dont want to use the security options on user level.
    is there any function to raise error??
    Please suggest thanks in advance.
    Regards
    AK

    Hi AK,
    As I understood from your question, you want to copy always from V01 to V02. No other versions will be used other than these 2. So, it will be better to have them hardcoded in your script logic, instead of keeping error messages for the user. Anyways, you dont want the user to enter anything other than V01 and V02.
    Hope this helps.

  • Error with Script logic

    Hello friends,
    I am getting an error with running currency conversion in an app, the error says Invalid dimension "C_Category". Here is the script logic, I dont see C_Category anywhere. For the record, the name of dimension is category.
    *RUN_PROGRAM CURR_CONVERSION
          CATEGORY     = %C_CATEGORY_SET% 
          GROUP = %GROUPS_SET% 
          TID_RA = %TIME_SET%
          RATEENTITY = GLOBAL
          OTHER = [ENTITY=%ENTITY_SET%]//For More than one other scope parameters: OTHER = [ENTITY=%ENTITY_SET%;INTCO=%INTCO_SET%...]
    *ENDRUN_PROGRAM

    Hello,
    Variable %C_CATEGORY_SET% means set of members selected for Dimension C_CATEGORY. So, if you want to use CATEGORY instead replace it with %CATEGORY_SET%, but if are running Consolidations I think you need C_CATEGORY Dimension.
    Regards,
    Gersh

  • Validate my script logic: reference erro LOOKUP is not defined

    Dear all,
    i want write one script logic. It use LOOKUP using FOR/NEXT.
    But when i check stament in my script logic: messesage erro: reference erro LOOKUP is not defined.Can you help me?
    My script logic
    *XDIM_MEMBERSET ACCOUNT=BS221
    *XDIM_ADDMEMBERSET CATEGORY = Actual
    *XDIM_ADDMEMBERSET ENTITY = CSO
    *SELECT(%TIME%,"[ID]",TIME,"[ID]>=2006.01 AND [ID]<=2006.02")
    *XDIM_MEMBERSET TIME = %TIME%
    *LOOKUP Rates
    *DIM  CATEGORY ="Actual"
    *DIM R_ACCOUNT ="AVG"
    *DIM R_ENTITY ="Global"
    *DIM INPUTCURRENCY="USD"
    *DIM MEASURES ="PERIODIC"
    *FOR %T% = %TIME%
    *DIM RATE_%T%: TIME =%T%  
    *NEXT
    *ENDLOOKUP
    *WHEN ACCOUNT
    *IS "BS221"
    *FOR %T1% = %TIME%
    *REC(EXPRESSION=LOOKUP(RATE_%T1%),TIME=%T%)
    *NEXT
    *ENDWHEN
    *COMMIT
    Thanks,
    Hungth

    Dear Vadim,
    I want test LOOKUP statement using FOR/NEX, then get value per member for member in LOOKUP.
    in excel add-in of Rates Model:
    Actual - Actual
    Average Rate
    Global Entity
    2006.01 - Jan 2006
    31
    2006.02 - Feb 2006
    30
    2006.03 - Mar 2006
    30
    2006.Q1 - Q1 2006
    30
    I want run my script logic above to get value from Rates Model ( 2006.01: 31, 2006.02 : 30, 2006.03: 30 ) to current model , to calculate in crurrent model.
    BS221 - Long Term Debt
    2006.01 - Jan 2006
    2006.02 - Feb 2006
    2006.03 - Mar 2006
    Actual - Actual
    31
    30
    30
    How i can write my script logic? My script logic statements is correct??
    Thanks,
    hungth

Maybe you are looking for

  • 7300 - DVI-I or DVI-D?

    Hi Im a little confused, does the 7300 output DVI-I or DVI-D? Cheers Nick

  • Job is in suspened state

    Dear SDNers, How do we know a job is in suspended state. because some of my ECC jobs are in Released\ from last 2 days and scheduled time as 2 days back only..it runs for every 3 hrs . Thanks,Swathi

  • Why are Java and Video Player updates appearing in Safari

    Today these fake Java and Video Player update pop ups started appearing in Safari 6.2.4, in OS 10.8.5.  The Java updates say I need  version 13 which doesn't exist and the video player pop ups are gray with a red square that resemble the Adobe colors

  • Bug when trying to commit for the first time

    I have a bug that I tried to solve but can't find any solution till now. I have a table that contains many rows and from this table I can press edit or add to open a new page that I can edit or add a new record for this view the page that contains th

  • WEB Query properties shows blank window

    Hi, on some of our web templates we have the problem that the query property window shows up with no content at all. Properties for characteristics and key figures work. Has anybody seen this / has an explanation for this? We are on BW 3.1C / 013, BI