Incorrect value with Script Logic

Hello,
From initial value called 2008.ORC we want to calculate for each month the percentage , from child DIASMES.
Now, with the script logic ( I´ll put down later) we have an incorrect value in the column 2008.TOTAL.
In other words, I´m sure I´m wrong with "WHAT" or "WHERE sentence or maybe the operation "FACTOR=USING/TOTAL" fails because the crossing between dimensions it´s incorrect.
*RUNALLOCATION
*FACTOR = USING/TOTAL
*DIM FABRICA_MAQ WHAT=BAS(FABRICAFF); WHERE=BAS(FABRICAFF); USING=BAS(FABRICAFF);
*DIM PRODUTOS WHAT=BAS(TOTALPROD); WHERE=BAS(TOTALPROD); USING=SP;
*DIM TIME WHAT=2008.ORC;WHERE=BAS(2008.TOTAL); USING=BAS(2008.TOTAL);
*DIM TIPO WHAT=BAS(TOT); WHERE=BAS(TOT); USING=ST;
*DIM VARIAVEIS WHAT=MIXACABADA; WHERE=MIXACABADA; USING=DIASMES;
*DIM DATASRC WHAT=INPUT; WHERE=INPUT; USING=INPUT;
*DIM VERSAO WHAT=BUDGET; WHERE=BUDGET; USING=BUDGET;
*ENDALLOCATION
*COMMIT
The Key is to see in the column 2008.TOTAL ( when we selected  "BAS") the value of parent divided into "DIASMES" !
Thanks !! 

Your factor statment references a TOTAL, but you don't reference the total in your DIM statements. If you look at the debug log carefully, you should notice that there's no calculation of a TOTAL value.
Try something like this. The only reason I move some dimensions from the *RUNALLOCATION up to the *XDIM's is for legibility, since the allocation makes no shifts to these dimensions. The logic should produce the same results, either way.
// These dimensions have no shift of data.
*XDIM_MEMBER VERSAO=BUDGET
*XDIM_MEMBER DATASRC=INPUT
// I'm assuming here that FACRICAFF is the top member of this dimension.
*XDIM_MEMBERSET FABRICA_MAQ = <ALL>
*RUNALLOCATION
*FACTOR = USING/TOTAL
*DIM PRODUTOS WHAT=BAS(TOTALPROD); WHERE=BAS(TOTALPROD); USING=SP; TOTAL=<<<
*DIM TIME WHAT=2008.ORC;WHERE=BAS(2008.TOTAL); USING=BAS(2008.TOTAL); TOTAL=<<<
*DIM TIPO WHAT=BAS(TOT); WHERE=BAS(TOT); USING=ST; TOTAL=<<<
*DIM VARIAVEIS WHAT=MIXACABADA; WHERE=MIXACABADA; USING=DIASMES;  TOTAL=<<<
*ENDALLOCATION
*COMMIT

Similar Messages

  • Package with script logic CANCELLED

    Hi everybody,
    I am trying to implement a very simple script logic that removes negative values from the Units account.
    *XDIM_MEMBERSET C_CATEGORY=%C_CATEGORY_SET%
    *XDIM_MEMBERSET TIEMPO=%TIEMPO_SET%
    *XDIM_MEMBERSET MERCADO=%MERCADO_SET%
    *XDIM_MEMBERSET ORG_VENTAS=%ORG_VENTAS_SET%
    *XDIM_MEMBERSET CUSTOMER=BAS(TOTALCUSTOMERS)
    *XDIM_MEMBERSET PRODUCT=BAS(00001)
    *XDIM_MEMBERSET P_DATASRC=DRIVER
    *XDIM_MEMBERSET ACCOUNT_SIM=Unit
    *XDIM_MEMBERSET TIPO_CLIENTE=BAS(TOTAL_TOP)
    [ACCOUNT_SIM].[#Unit]=IIF(([ACCOUNT_SIM].[Unit])*(-1)<0, 0, [ACCOUNT_SIM].[Unit])
    *COMMIT
    When I execute it with the Data Manager the result of the package is "Cancelled". I have one large dimension ("Customer" with more than 2000 elements) but there are not too many records in the database now. However, when I restrict the number of elements, the package works fine. It seems like a memory issue, I don't know... We are using SAP BPC NW 7.0 SP5
    Any idea out there? Is our logic not 'optimized' for BPC?
    Thanks a lot,
    Mr. Albert Mas

    Hi Albert,
    I think you're running into a dimensionality limit. I believe this was fixed in SP06.
    In any case, it's easy to fix. Just add
    *XDIM_MAXMEMBERS CUSTOMER = 1
    after your other *XDIM statements.
    You should be able to up this number a fair amount, depending on the number of members in other dimensions. In the script logic evaluation, there is code that multiplies the number of members in your memberset in each dimension and then attempts to assign the result to an INT datatype. I don't remember the size of the INT, but if you look at the short dump in ST22 of the SAP GUI, you'll see the code.
    Hopefully that helps.
    Ethan

  • 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

  • Fetching property value in script logic!!

    Hello Experts,
    We are using BPC 7.5 M, I am working on a script logic and need to fetch a value of a property of a dimension member where dimension member is itself defined in some property.
    We have a Org dimension which has a property "FORECAST_UNIT" and this property contains a member Id of Org dimension itself, In my script logic I need to fetch value of "Currency" property for the Org dimension member defined in "FORECAST_UNIT" property.
    Please Advice.
    Thanks & Regards,
    Rohit

    Hi Roberto,
    Attached code (In Image) is of our Aggregate Forecast Unit logic, Every Org (Entity) has an forecasting unit defined in Forecasting unit property in Org dimension and Forecasting unit is also a member of Org dimension, below logic aggregates the data at Forecasting unit level:
    The issue is that I need to check before the code marked in Red executes that if Org-- Forecasting unit -- Currency is USD then only Red part of logic should execute.
    Thanks & Regards,
    Rohit

  • 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

  • CSA: Use with Script Logic

    Has anybody used CSA to protect a Script logic server. With so many remote applications attempting access to the script logic server and files, what method do you find is best to keep this server protected without opening up too many holes?
    Thanks!
    -Wyley

    I would make a group of servers that are allowed to talk to the Script login server and either turn off alerts for them or just make them informational.
    Also create another protection policy if you want even more protection on that server.

  • Allocations with Script Logic

    Hi Experts,
    We're trying to run script logic for allocations, but aren't able to sum to values to one Costelement.
    In the Account dimension we have:
    - Costelements (CE)
    - Keyfigures (KF)
    - Prices (PR)
    What we want to do is:
    write (KF_A * PR_A) + (KF_B * PR_B) to CE_A
    Any suggestions on the right syntax would be very welcome.
    Regards,
    Vincent

    Hi,
        Can you explain me clearly so that i can give you solution.
    Regards,
    Naresh.K

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

  • Incorrect values with AGO function

    Hi,
    I am trying to fix a problem where my AGO function is producing close but not 100% correct values.
    I have:
    Fact Table (pk is by date, employee, and measure keys)
    Dim Date Table (only date, month, quarter, year - very simple) Month and quarter are just numbers (not identified by year)
    Dim Emp Table
    I have a logical dimension hierarchy for Dim Date: Total > Year > Quarter > Month > Date
    In my Logical Fact table, I have a SUM column for the measure. My AGO column is just AGO(Measure (SUM), Dim Date.Month, 1)
    For my report, I have tried a few things.
    If I just use the Month column from my Date table, the AGO numbers are way off. If I do MONTH(Date) instead, the AGO numbers are close, and even accurate most of the time, but sometimes they will be a little bit off, by only 1 or 2 usually.
    I'm having the hardest time trying to figure this out, but one thing I'm suspicious of is the Date table - should Month and Quarter be like 2008-01, 2008-02, instead of just 01, 02?

    It would come as no surprise to me if the datetime dim is incorrect. I have been cleaning up someone else's mess.
    The date dim is just this:
    desc date_dim;
    Name                           Null     Type                                                                                                                                                                                         
    DATE_KEY                       NOT NULL NUMBER(8)                                                                                                                                                                                    
    D_YEAR                         NOT NULL NUMBER(4)                                                                                                                                                                                    
    D_MON                          NOT NULL NUMBER(2)                                                                                                                                                                                    
    D_DAY                          NOT NULL NUMBER(2)                                                                                                                                                                                    
    DATE_VALUE                     NOT NULL DATE                                                                                                                                                                                         
    D_QUARTER                      NOT NULL NUMBER(1)                                                                                                                                                                                    
    6 rows selectedFor today's date:
    DATE_KEY               D_YEAR                 D_MON                  D_DAY                  DATE_VALUE                D_QUARTER             
    20090417               2009                   4                      17                     17-APR-09                 2                     
    1 rows selectedI tried making the logical columns for D_YEAR||D_MON and D_YEAR||D_QUARTER, and added them as non-drillable chronological keys in my hierarchy, but still getting the same results.
    Any ideas?
    Edited by: KevinC_VA on Apr 17, 2009 2:40 PM

  • Help with Script Logic

    Hi All
    I am trying to write the following script
    *INCLUDE ..\finance\system_constants.lgl
    *XDIM_MEMBERSET RATE=AVG,END
    *SELECT(%IP_Currencies%, "[ID]", "INPUTCURRENCYDIM", "[MD] = 'D' OR [MD]= 'M'") )
    *XDIM_MEMBERSET INPUTCURRENCY= %IP_Currencies%
    *XDIM_MEMBER RATESRC=RATEINPUT
    *WHEN INPUTCURRENCY.MD
    *IS "D"
    *REC(EXPRESSION=ROUND(1/%VALUE%,6),RATESRC="RATECALC")
    *ELSE
    *REC(RATESRC="RATECALC")
    *ENDWHEN
    *CLEAR_DESTINATION
    *DESTINATION RATESRC=RATECALC
    My LGX file looks like this.
    *XDIM_MEMBERSET RATE=AVG,END
    *XDIM_MEMBERSET INPUTCURRENCY= DZD,USD,ARS,AUD,ATS,BSD,BBD,BEF,BMD,BRL,GBP,BGN,CAD,CLP,CNY,CYP,CZK,DKK,XCD,EGP,EUR,FJD,FIM,FRF,DEM,XAU,GRD,HKD,HUF,ISK,INR,IDR,IEP,ILS,ITL,JMD,JPY,JOD,LBP,LUF,MYR,MXN,NZD,NOK,NLG,PKR,PHP,XPT,PLN,PTE,ROL,RUR,SAR,XAG,SGD,SKK,ZAR,KRW,ESP,XDR,SDD,SEK,CHF,TWD,THB,TTD,TRL,VEB,ZMK
    *XDIM_MEMBER RATESRC=RATEINPUT
    *WHEN INPUTCURRENCY.MD
    *IS "D"
    *REC(EXPRESSION=ROUND(1/%VALUE%,6),RATESRC="RATECALC")
    *ELSE
    *REC(RATESRC="RATECALC")
    *ENDWHEN
    *CLEAR_DESTINATION
    *DESTINATION RATESRC=RATECALC
    It gets validated fine and it also runs successfully through DPM. But the problem i am facing is that the above script is only running and posting data for USD  in RATECALC where as I have lot many currencies listed in "INPUTCURRENCYDIM". It does not execute for any other currency except for USD. I want to run it for all the currencies.
    Please suggest.
    Diksha.
    Edited by: Diksha Chopra on Jun 3, 2010 9:23 PM

    Hi Diksha,
    Please check in your inputcurrency dimension, how many members are there with the property MD as D?
    I would suggest you to change your scritp to
    *INCLUDE ..\finance\system_constants.lgl
    *XDIM_MEMBERSET RATE=AVG,END
    *XDIM_MEMBER RATESRC=RATEINPUT
    *WHEN INPUTCURRENCY.MD
    *IS "D"
       *REC(EXPRESSION=ROUND(1/%VALUE%,6),RATESRC="RATECALC")
    *IS "M"
       *REC(RATESRC="RATECALC")
    *ENDWHEN
    *COMMIT
    *CLEAR_DESTINATION
    *DESTINATION RATESRC=RATECALC
    Hope this helps.

  • Declaration issues with  script logic

    we use to write the logic as below in 5.1
    *MEMEBERSET(%PRODUCT%,"Desendents(PRODUCT_LTERM.TOT_PROD,999,LEAVES)")
    *XDIM_MEMBERSET ACCOUNT_LTERM=100000000_D,110000000_D,120000000_D,130200000_D,
    *XDIM_MEMBERSET DATASRC=INPUT
    *XDIM_MEMBERSET ENTITY_LTERM=%ENTITY_LTERM_SET%
    *XDIM_MEMBERSET PRODUCT_LTERM=%PRODUCT%
    *XDIM_MEMBERSET RPTCURRENCY=LC
    *XDIM_MEMBERSET SCENARIO=%SCENARIO_SET%
    *XDIM_MEMBERSET TIME_LTERM=CY,CY+1
    *WHEN *
    *IS *
         *REC(EXPRESSION=0)
    *ENDWHEN
    As we know that sql based keywords are not used now in thi new version 7.0
    I want to know the replacement in 7.0 for *MEMBERSET() COMMAND and also
    How * in when command for specificing consideratrion of all the declaration is replaced in 7.0

    Hi sheldon,
    Thanks for your time in replying to the question. Chennuru and I are working together.
    Let me give you a clear picture of our issue.
    1. *memberset() command which is used to retrieve a list of members of a particular dimension, is not being recognised in 7.0NW version.
    We want to know if we have any replacement or other format for this command.
    2. After declaring the dimensions using XDIM_MEMBERSET statements for all the existing dimensions, if we need to manipulate on all the existing combinations we use
    WHEN *
    IS *
                                                                               REC(EXPRESSION=0)
                                                                         *ENDWHEN
    In this case, the star to the right of the when is not recognised. Even if we replace * with <ALL> the result is not achieved.
    We would like to know what must be used to select all the existing dimensions.

  • Applescript returns incorrect value with blank cell

    Imagine there is a column of numbers, some which might have the value 0.0 and some which are blank. Imagine wanting to append a data set at the first blank cell using Applescript. As Applescript is currently implemented in Numbers, this is not possible. See the following test.
    1. In Numbers, create a new blank spreadsheet.
    2. Select cell "A1".
    3. Format as text.
    4. Execute the following line of Applescript,
    tell application "Numbers" to get value of cell "A1" of table 1 of sheet 1 of front document
    It returns "0.0".
    I would expect a return "" since it is a empty cell formated as text, no less.
    Because of this, there is no way to find a blank cell since a blank cell returns a value of 0.0 which might be a valid entry.
    Anyone have any ideas for a work around?

    The value of a blank (empty) cell IS zero.
    The value of a cell containing a string whose length is zero contains "".
    Given that, I will post a report because I'm not sure than the value returned in AppleScript is the good choice.
    In AppleWorks for a blank cell, the returned value was "".
    Yvan KOENIG (from FRANCE dimanche 11 janvier 2009 16:31:35)
    +Your tracking number for this issue is Bug ID# 6487875.+
    Hello
    +(1) May I know if the fact than+
    +set v to value of cell "B12"+
    +returns 0.0 when the cell is blank is the designed result.+
    +In AppleWorks in this case, we are accustomed to get an empty string.+
    +(2) In version 1, a cell containing an empty string was accepted in an arithmetic operation.+
    +In version 2, it is rejected.+
    +Is it a design choice or is it a bug ?+
    +Your tracking number for this issue is Bug ID# 6487879.+
    Hello
    +In Numbers, as long as we are referencing cells of the current row (200 for instance), we may use short references like:+
    =(BC)*(DE)
    +When we save as iWork '08 document, the formula is expanded as+
    =(B200C200)*(D200E200)
    +Is it a design choice or a bug ?+

  • PDETextGetBBox returns incorrect value with Italic font

    Hello,
    I use PDETextGetBBox to retrieve the BBox of PDETextRun which are created with an italic font (in my case Arial Italic). Unfortuantely the returned AsFixedRect is not correct because it doesn't take into account the skewing of the char.
    Is it normal? A bug? A wrong usage of the SDK method?
    Thanks in advance,
    Joe

    Ok but the bounding box should contain all the TextRun. By the way I have the same behavior with the Quad.
    The solution is to use the PDEElementGetBBox but in this case it's too large.
    Any idea?
    Thanks in advance,
    Joe

  • How Acumulated Value in a script Logic

    Hello,
    We facing a problem here, that we cannot acumulated value using  script Logic.
    We need to calculated a account where we need the value to this account in the previous month
    Like That
                                JAN        FEB       MAR       APR        MAY
    ACCOUT
    A                          10           40          45         45            45
    B                           7            30          20         
    C                           3                        -15                  
    In this case we need to save the acumulated value to all months, until the end of the year, even if we dont input value in this months.
    Anyone facing this problem? 
    Best Regards

    You can't use a date display pattern on a text field, it has to be a date field.
    The only way around that is to use scripting to format the date and then put the date in a text field - I've done this using util.printd() (I think - going off the top of my head at the moment) and there's a way to do it with FormCalc too.
    Patterns work well once you get the hang of them. Display is how you want the data to look. Edit is the different ways you allow the data to be entered (multiple date, phone number patterns, etc.). Validate will validate that the Display pattern has succeeded. Data is the format to export.
    I haven't had a chance to look at your new file but if you use 2 date fields with patterns you would just need: dateField2.rawValue = dateField1.rawValue; with dateField2 having date.long{} as the display pattern. Come to think of it you could use Global binding and give the fields the same name and you wouldn't have to do any scripting.
    Radzmar has a good explanation of using multiple edit patterns for dates (English text is part way down): http://thelivecycle.blogspot.de/2011/10/date-patterns.html

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

Maybe you are looking for