Conditional Checking in Script Logic

Could anyone please kindly enlightened me how I could code the following in the script logic?
Scenario:
IF A > 0, THEN B = C * D
I have tried with SELECTCASE statement statement but all wouldn't work, I keep getting errors...
SELECTCASE:
*SELECTCASE [P_ACCT].[0005]
*CASE > 0
         *REC(EXPRESSION= ([P_ACCT].[0004] * [P_ACCT].[0003]), P_ACCT=0001)
*ENDSELECT
Error:
UJK_VALIDATION_EXCEPTION:Unknown or unimplemented keyword "*REC(EXPRESSION=IIF([MATERIAL].[LDG0005]=>0,([MATE"...
Thank you very much in all advances.
Best regards,
Yen Li

Hi Yen Li,
Applying SELECTCASE - ENDCASE combination would not produce the desired results. Instead, use Validation Business Rules - by setting up Validation Rules and Validation Rules Details and run the Stored Procedure SPRUNVALID from the Default Logic to execute these validation rules. Call the Stored Procedure by the following syntax:
RUN_STORED_PROCEDURE=SPRUNVALID(u2018applicationu2019,u2019categoryu2019,u2019currencyu2019,u2019%SCOPETABLE%u2019,u2019%LOGTABLE%u2019)
Your command: u201CIf P_ACCT.0005 is > 0, multiply P_ACCT.0004 by P_ACCT.0005 and post the product in P_ACCT.0001. Otherwise do not do anything.u201D will be shown in result!
Regards.
Chakrapani

Similar Messages

  • Member ID checks in Script Logic

    I thought I saw a note recently that the 7.5MS version of BPC added a new feature to check that the Member IDs being written to in a *REC statement would be validate so that you would avoid the problem of invalid member id's in the cube. However, when I read the release notes I see no mention of this. Has anyone else seen information on this issue and if so can you point me to it?

    Thanks Anis, I saw the notes on the checks when you validate and save. I was wondering if you are dynamically creating the Member ID if it will valdate the Member ID during logic execution before it writes the record. For instance, if I am pushing data from Payroll to Finance and the Account Member I should write to is based on a property on the PayAccount Dimension my REC statement might look like this
    *REC(Factor=1,Account=PayAccount.GLAccount)
    The system cannot validate this when I validate the logic. If the property is not set up correctly it will try to write the data using the value in the property. In versions up to 7.5 it would simply write the record to the Fact table with the invalid Account Member ID. When you process the App you would then get an error noting that there were invalid member IDs in the cube.

  • Script Logic - Calculated Members

    Hello:
    Im trying to build a script member using calculated members:
    *WHEN CUENTA
    *IS U4000
    *ENDWHEN
    *COMMIT
    U4000 is a calculated member in the account dimension member. I tried using another account, that is not a calculated member and it works.
    How can use calculated member in this sintax?
    Thanks in advance.
    Luciana

    I would like to mention few things:
    1. OLAPLOOKUP it doesn't work anymore into 7.5. James can you double check. My tests is showing that OLAPLOOKUP is not even validate into 7.5
    2. Calc_Dummy_Org it is an option to get the values of calculate members
    3. It is strange that kind of condition because into script logic you are doing input for base members.
    So that condition to test when an account is a an account which is not base member for me doesn't seems to be right.
    I can understand if you are looking about the value of that account but not testing if an account it is an account which is not base member.
    So if you want to record something with value of your calculate member just use:
    *BEGIN
    ACCOUNT.#basememberforinput = ACCOUNT.Calculatemember
    *END
    *COMMIT
    Edited by: Sorin Radulescu on Nov 9, 2010 4:04 PM

  • 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

  • Script Logic - Check Work Status

    Hi,
    I am using the standard process chain "/CPMB/DEFAULT_FORMULAS_LOGIC" to trigger Script logic file.
    I have created some logic to clear and copy data to a targer category. I want to check the workstatus of the target category and if it is locked i want to clear/copy to fail.
    I am not sure how to go about this? I was thinking of adding the following but that is just a guess!
    TASK(/CPMB/CLEAR_SOURCE_CUBE,CHECKLCK,1)
    any advice would be helpful.
    Thanks,

    Hi,
    Ideally did want an option for the user to select option to check whether the copy should happen if the data had been locked. Have done this via the standard COPY package.
    Can this be done with the script logic e.g. using paramters in the package?
    Or if you create a script logic file does it always check the workstatus?
    thanks

  • Script Logic - Amount Condition

    Hi all,
    I want to create a script logic that calculates a new account based in another account. For example, i have the account XXX and the account YYY.
    In Pseudocode my condition is:
    If Account XXX < $2500
    then Account YYY= 100;
    How can i create a script logic that executes my pseudocode?
    Thanks.
    Regards,
    Jorge

    Hi,
    For your example, you can try
    *WHEN GET(ACCOUNT = "XXX")
    *IS < 2500
       *REC(EXPRESSION = 100, ACCOUNT = YYY)
    *ENDWHEN
    *COMMIT
    To know more about the when statements, please go to the following link
    http://help.sap.com/saphelp_bpc75/helpdata/en/a5/719a63b6fa4ef0964d11d69c607803/content.htm
    Hope this helps.

  • 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

  • Condition in script logic.

    I need to copy the 'All Account'  % value in datasource 'A' to 'All Account' , All costcenters with in same data source.
    This I need to copy only for those cost centers, for  which transaction data exist in data source 'B' for this period
    How to achieve this in script logic.
    Appreciate input
    Regards,

    In such case you need to modify that script in the following way.
    Add
    *XDIM_MEMBERSET COSTCENTER = <source cost center>
    *SELECT(%ALL_CC%, ID, COSTCENTER, "[CALC] = 'N'")
    at the beginning and put the following loop around *REC statement.
    *FOR %ONE_CC% = %ALL_CC%
    *REC(EXPRESSION = [DATASRC].[A], DATASRC = B, COSTCENTER = %ONE_CC%)
    *NEXT

  • Handling Ranges in Script Logic

    Hi Experts
    Is it possible to put logic to check a range of values in Script Logic.
    For example, if I need to check if the value in Quantity Account is between 200 and 800, then only some Quantity Discount is calculated against this.
    What command should one use for this
    Any input would be very helpful.
    Regards
    Krishnendu

    Hi Krishnendu,
    I believe that you can use MDX or a BADI to do this. Using MDX, for example, the following should write 100 to the QUANT_DISC account in the event that QUANTITY is greater than 200 and less than 800:
    [ACCOUNT].[QUANT_DISC] = IFF(([ACCOUNT].[QUANTITY]) > 200,IIF(([ACCOUNT].[QUANTITY])<800,100,0),0)
    This is just example MDX code - you'll have to adapt and test yourself. I suggest using the script logic tester to speed the process. Performance may be less than ideal, and you can certainly implement this in a BADI in that event.
    It would be nice if it were possible to do this using WHEN/IS statements in script logic, but at present conditional logic based on measure values is not supported in that context.
    Ethan

  • Pull script logic

    Hi all,
    need some help on writing the script logic.
    Here's the condition:
    We have 2 applications (apps A with 10 dimension and apps B with 6 dimension)
    I'm trying to write a script logic that run at apps A referring data from apps B. Actually i've tried using *LOOKUP and *XDIM_GETINPUTSET syntax. When checking the debuglogic file, source values are doing fine but somehow I couldn't manage to write them into apps A due to dimension difference (i've tried using *DESTINATION_APP and *ADD_DIM, too).
    Thanks.

    Hi Nilanjan,
    Here's the script logic:
    *LOOKUP APP_B
    *DIM RPTCURRENCY="LC"
    *DIM DATASRC="INPUT"
    *DIM INTCO="NON_INTERCO"
    *DIM CATEGORY="BUDGET"
    *DIM SUBACCOUNT="NON_SUBACCOUNT"
    *DIM AAA:ACCOUNT="LCS"
    *ENDLOOKUP
    *XDIM_MEMBERSET ACCOUNT = LCS
    *XDIM_MEMBERSET TIME = 2010.JAN
    *DESTINATION_APP = APP_A
    *ADD_DIM= NON_DIM7,NON_DIM8,NON_DIM9,NON_DIM10
    *WHEN TIME
    *IS 2010.JAN
         *WHEN ACCOUNT
         *IS "LCS"
              *REC(EXPRESSION=LOOKUP(AAA),ACCOUNT="LCS",DIM7="NON_DIM7",DIM8="NON_DIM8",DIM9="NON_DIM9",DIM10="NON_DIM10")
         *ENDWHEN
    *ENDWHEN
    *COMMIT
    I add the *DESTINATION_APP and *ADD_DIM because when running the logic debugger without them it only shows "No record to process".
    I've managed to find the workaround using *RUNLOGIC now.
    Thanks again for your attention.

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

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

  • 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

  • An error in Script Logic

    Hi Experts,
    I have a problem with one of the FXTranslation logicu2019s in one of my report can u please help me on that.
    The logic works fine for 2 reports out of 3, for the 3rd report I donu2019t know why itu2019s not doing the translation to USD. As far as the design of the report goes the 2 reports for which translation works fine comprises of 2 logics one for percentage allocation and other for translation from LC to USD, whereas the 3rd report needs only translation but doesnu2019t need the allocation logic to be run.
    The conversion for the 3rd report happens if I comment out the allocation logic. Both these logics are mapped to Default.LGF file. I am unable to figure out what could be the error.
    Below is the Script Logic for Aloocation and Translation:
    //Budget Allocation
    *SELECT(%CURR%,"[ID]","RPTCURRENCY","[CURRENCY_TYPE]='L' OR [CURRENCY_TYPE]='R'")
    *XDIM_MEMBERSET RPTCURRENCY=%CURR%
    *RUNALLOCATION
    *FACTOR=USING/1
    *DIM ACCOUNTB WHAT=[IS_ALLOC]='Y'; WHERE=<<<; USING=ALLOCPER
    *DIM PRODUCTM WHAT=NOPRODUCT; WHERE<>NOPRODUCT; USING=<<<
    *ENDALLOCATION
    *COMMIT
    // Currency Translation
    *SELECT(%REPORTING_CURRENCIES%, "[ID]", "RPTCURRENCY", "[REPORTING] = 'Y'")
    *SELECT(%FX_RATES%, "[ID]", "RATE", "[GROUP] = 'FX RATE'")
    // Load the rates from the RATE cube
    *LOOKUP RATE
                *DIM CATEGORY="BUDGET"
         *DIM RATEENTITY="GLOBAL"
         *DIM RATE=ACCOUNTB.RATETYPE
         *DIM SOURCECURR:INPUTCURRENCY=LEGALENTITY.CURRENCY
         *FOR %CURR%=%REPORTING_CURRENCIES%
              *DIM %CURR%:INPUTCURRENCY="%CURR%"
         *NEXT
    *ENDLOOKUP
    //  define the translation rule
    *WHEN ACCOUNTB.RATETYPE
    *IS "NOTRANS"
         // skip
    *IS %FX_RATES%
               // translate
         *FOR %CURR%=%REPORTING_CURRENCIES%
              *REC(FACTOR=LOOKUP(%CURR%)/LOOKUP(SOURCECURR),RPTCURRENCY="%CURR%")
         *NEXT
    *IS "COPYLC"
         // take as is
         *FOR %CURR%=%REPORTING_CURRENCIES%
              *REC(RPTCURRENCY="%CURR%")
         *NEXT
    *ENDWHEN
    *COMMIT
    // Default
    // FX Translation
    *include FXTranslation.lgf
    // Budget Allocation
    *include BudgetAllocation.lgf

    Hi Naresh,
    One thing that helped me solve the problem was I needed to use different set of Dimension members/property in the Logic i.e What, Where and Using to trigger off the Curency Translation.
    But please make sure that you use try to understand a unique dimension (member/property) used and use that to trigger off the translation or anything for that matter. My other two translations were working fine as the parameters i used were unique for them whereas the remaining one needed alteration in the logic only in the parameters used in What, Where and Using, so had to add one more set of Translation Logic for this exclusively.
    Another point you need to check in your Rate Application is whether you have your Reporting Currency as value 1, say for eg USD is your reporting currency then the value in Rate Application for USD must be 1, if u by mistake cleared of this value when using the Clear Data Manager Package so the multiplication with 0 results in no conversion.
    These were the two points that helped me solve my issue. I hope it helps.
    Rgds,
    Rizwan
    Edited by: Rizwan Mustaffa on Jul 13, 2009 12:09 PM

Maybe you are looking for

  • Goods Receipt and Amoratization to Internal Orders (CO)

    Dear SAP Gurus - Please could you kindly assist in this matter. Our Production department is unable to upload the plan cost / unit cost to the 1st impression production order number, as stock was received before for the old title. Instead of creating

  • Problem with Layer order

    I have a menu that is on a top layer that scrolls up to reveal a second menu on the next layer. When clicking a link or scrolling up, the behavior is correct in that the menu scrolls up revealing the menu below. However, when scrolling back down, the

  • Migrate Files from Windows to new iMac Leopard

    Can anybody give me idiot proof, step by step instructions to connect my PC to my Mac and copy files. I'd love to be able to plug my PC into my Mac and transfer through an ethernet cable, but I'm not sure how all that would work. I do have a wireless

  • Release Date in Get Info always 6/5/1905 and not editable?

    In Get Info, in the new iTunes, the Release Date is not editable.  However, when downloading books and importing into iTunes, the Release date is always 6/5/1905.  Now I don't think either music or books or anything likely to be downloaded was releas

  • How to separate business from personnal in mail

    I'm using 5 different account in mail, some are for business, some for personal use. Sometime, a business mail is send from a personal account by error and vise versa. Is it possible to have two mail application? One for business and one for personal