Conditional calculation

Hi,
I am using Adobe Acrobat 5.0 to preparing a tax return form.
I have to fields - 1. Total tax payable and
                        2. Total reliefs which is the sum of four fields (for simplicity lets take them as Relief 1, Relief 2, Relief 3 and Relief 4).
I want your help in writing a custom script which will achieve the below:
a) if Total tax is less than/equal to total relief, then the total relief should be restricted to total tax. for example if total tax is $1000 and the total relief is $1200, then $1000 should appear in the Total relief field.
b) else the sum of all the reliefs should appear in the Total relief field. for example if total tax is $1000 and the total relief is $800, then $800 should appear in the Total relief field.
Many thanks for your help.
Regards,
Vijay

Do you want to show the minimum value between the two? If so, this should do what you want.
Create your two fields 'totalTaxPayable' and 'totalReliefs' and set the totalReliefs field to calculate your totals from Relief.1, Relief.2, etc. You can hide the totalReliefs
Then create a third field to display the min value, call it 'totalReliefsDisplay' and put this in the custom calculation script:
event.value = Math.min(this.getField("totalTaxPayable").value, this.getField("totalReliefs").value)

Similar Messages

  • Is it possible to sort the list of Conditions/Calculations?

    Is it possible to sort the list of Conditions/Calculations so that they display alphabetically in the list?
    My list of conditions is getting quite long and haphazard now!
    Cheers
    Sapphie

    I was afraid of that!. It is very disappointing because , as I am developing a set of reports for the first time, I will create conditions/calculations in quite a non-ordered way and then end up wanting to group similar ones together.
    Hopefully a future version will allow this?
    Lee

  • Conditional Calculation/Filter in Crosstab

    Hi All,
    Is there a possibility to make conditional calculation in a crosstab ?
    I want to filter some records, if their key figures are under a certain value.
    There is a possibility to write formula for that key figure and suppress related records (e.g if key figure is < 100 etc..). But I want those records not to come to cross tab at all. In BW queries, we can create "condition" for that purpose. I wonder if there is such a functionality in CR also.
    Thanks in advance
    Ozan

    Hi,
    1. create a formula field in the field explorer.
    Example: Formulafield name is "Sales" and the formula is
    IF >20000 then
    2. Create Cross-tab, go to Cross tab Expert , select the previously created formula field into summarized fields.
    Regards, Anil

  • Report Condition - calculation using "in"

    Hi,
    In the conditions of a report, I would like to define a condition
    A in ('abc','def',...).
    Any time that I have tried it in the past it has been a problem (depending on how I wrote the condition, I would either get an error message or it would only use the first item in the list). Up until now I just used a separate condition for each item with the connection OR.
    However, now I have a list of 11 items in the condition and it would be much easier if the IN statement was possible.
    We have Discoverer 10.1.2.1 but in three weeks will be upgrading to 10.1.2.3.
    Thank you.
    Leah

    Hi Tamir,
    I cannot believe that after all the times that I tried different ways to work out using "IN", just now I realized what the problem is.
    The only way that the IN can be defined is if I write the value list in the space itself in the condition statement. I CANNOT use the "Create Calculation" choice. If I do, and use parenthesis, then I get an error that it is an invalid statement. If I leave the parenthesis out, then it just accepts the first value in the list and leaves the rest out of the condition.
    Just curious - is this just a problem in this version of Discoverer, or is using the "Create Calculation" an incorrect assumption on my part?
    Thank you.
    Leah

  • Freight condition calculated on header level , not at item level

    Hi,
    I am creating PO with 2 line items..
    mat X qty 1 price 100 INR
    mat Y qty 1 price 100 INR
    Now i have given freight as 500 INR in header level...
    My prob is freight is getting calculated based on number of  item level...
    It means if i have 2 item levels my freight is coming 1000 INR....
    it is adding based on line item.....
    but it shud come 500 INR....
    I want my freight to be added at header level......
    Utsav

    HI
    What will u do if in case freight shud be 500 + 500 = 1000
    So leave this condition as it is
    Goto Tcode M/06 ... and create a new condition for freight ... by copying the present condition type and then add it in pricing procedure
    But in "details "of this new condition type  put a tick mark against group condition and header condition.
    "To go into details of a condition type ... select the condition type and then click on lens button"

  • FI: Payment condition calculating 2 due-dates depending on document-date

    Hello community!
    I'm searching for a definiton of a FI-payment-condition which is calculating two different due-dates depending on document-date.
    E.g.:
    Invoices dated from 01.03.08 till 09.03.08 should be paid on 10.04.08.
    Invoices dated from 10.03.08 till 31.03.08 should be paid on 10.05.08.
    Or must this be realized by a FI-substitution???
    Thanks for an answer.
    Kind regards,
    Bernd

    Hello,
    You didnot mention if u need posting date as base or document date. However your scenario, below is
    the answer for your query is
    1. Create one customised payment term only eg. XXX
        for first scenario,
       Day limit is 9 ;
       under payment terms tab , fixed date 10, Addl month 1
       for second scenario
       in the same payment term XXX
       Day limit is 31,
       under payment terms tab , fixed date 10, addl month 2.
    Explanation.
      as day limit is 9, what ever the dates of transaction between 1-9 it picks first setting
    and after 9th until 31st it picks second setting.
    I hope this clarifies you.
    Thanks
    G.Bharathi

  • Pricing Condition - Calculation

    I need to configure a scenario in Pricing with the formulae:
         Pricing = Quantity x k Factor x Price maintain in VK11
    k Factor is a variable that comes from a file (usually it is 0.4, 0.6 or 1). The program will read the file and interpret that into a Sales Order and Invoice.
    Pricing has to be calculated in the line item as above. Any idea how I can solve this.
    Kind Regards

    Dear Anand,
    you can do this by writing a logic in condition formula calculation rule and that routine has to assign to you base price condition.
    1.Any how system will calculate price = Qty * price in VK11 now you apply logic to multiply with K factor through routine.
    2.second way is that you can add  one more line item 20 as per the below screen shot and there you can apply logic for K Factor , because for your understanding you can maintain like this .
    Regards,
    C.B Reddy.

  • Is conditional calculation in the report possible?

    Hi,
    While using currency translation in a query, amounts are being multiplied by 100 for currencies JPY, KRW & TWD.
    Is there a way to divide these currencies by 100 if currency key is one of above mentioned type?
    I've already checked notes 153707 & 760195 which are relevant to my issue.
    other options are fixing this bug which could be a nightmare for us as "Currency decimal bug" originated from R3 settings.
    we have many functions & programs (both in R3 & BW) where we hardcoded to get the correct value.
    So, we might not be able to handle this bug so easily by removing above mentioned 3 entries from table TCURX.
    Appreciate any kinda help.
    Thanks,
    hari immadi
    http://immadi.com
    SEM BW analyst

    Eugene,
    you are right. I could able to manage with a total of just 10 columns (same as before) & still get the correct results.
    only change I've made to your solution is, "not equal to < >" rather than "greater than >" in the formula you have proposed.
    So, final formula is as follows.
    ( ‘CUR100’ < > 0 ) * ' CUR100' * 100 + NOT ( ' CUR100' < > 0 ) * 'YourKF'
    It took 2 hours for me to figure out why 9 columns are working with your formula but not 1 column.
    1 column is having a debit (negative amount) for currencies JPY, KRW & TWD and is not dividing by 100 as it is not meeting formula condition.
    Overall, your solution is great & it helped me a lot.
    Sudhakar,
    I agree with you on writing a transfer rule to divide by 100. But, we are dealing with a Transactional/Basic combo cube so, I just can't depend on transfer rules. But, am sure that will work.
    Srini,
    thanks for your reply. Appreciate if you can share what exactly you are doing with your code & where the code is written.
    Thanks,
    hari immadi
    http://immadi.com
    SEM BW analyst

  • Header conditions calculated on item level.

    Hello,
    We are on SRM 4.0 (server 500). I have created a header pricing condition as a copy of 01RH for a surcharge. I created a contract with the condidition that a surcharge of ZAR 65 to be added for all orders below ZAR 1000. When I create a shopping cart the surcharge is added to all the items, and not to the total of the shopping cart. The requirement is to calculate the charge as per the total value of the shopping cart.
    Any ideas on how we can acheive this?  Is there a badi we can implement?
    Regards
    R

    Hi,
    I'm not sure of the Shopping Cart functionality of SAP CRM. Might be CRM E-commerce have a shopping cart or a shopping basket feature. You can have a look at SAP CRM Help Portal.
    [CRM WebChannel|http://help.sap.com/saphelp_crm70/helpdata/en/a9/0fff29fa4c46bca6e01d70e9201e92/frameset.htm]
    If you are using the CRM One Order API's to persist data in the Database, then probably you can have a look at the BADI - ORDER_SAVE. This is badi which will be triggered and you can code you own application logic. But, have a look at the BadI documentation and sample implementation. The sample implementation class is - CL_EXM_IM_ORDER_SAVE.
    I hope this will help you somehow.
    Thanks,
    Samantak.

  • Javascript Help - Conditional Calculation

    Hello:
    I am trying to figure out how to perform an averaging calculation on a form.  Here's my problem, I've attached a ss:
    I have 4 columns, each representing a unit.  In the weekly attendance summary at the bottom, I calculate the attendance percentage for that unit.  The issue is that not all units have a 'Delta' sub-unit and when the Total average is calculated at the bottom right for TRAINING, I don't want to consider units that are not being used.  What I did so far was set Delta's total to 100 if their attended at the top was 0 as that would mean they are not in existence.  Looking for a better way to do this.
    Thanks,
    -e

    Hi George:
    Thanks very much for your answer.  I ended up having to make a couple changes.  Here's what the whole thing looks like:
    What I need to figure out how to do is populate the fields under training and roll-call on the left side with calculations based on the selection in R/C or Trg.  So, if I put a person's name in under Alpha and beside their name select AWOL, over on the left, I want it to add 1 in the AWOL row for Alpha.
    I have no idea how to get started, although with some pointers I am sure I can figure it out.  I did manage to sort out the problem from the first question I had and I am embarassed at how easy it was in retrospect.  Another unrelated question, is there a way to set it up such that once you have made a selection from the combo box, the arrow to the side disappears?
    Thanks again,
    -e

  • Need help with a conditional calculation...

    I have a field that the user chooses as either a percentage of their income, or as a dollar amount. Based on what they choose, I'm using actions to show/hide the unchecked field. When using the percentage, it takes the annual salary that they input and divides it by the percentage they input, and displays that dollar amount in another field. Problem is I get an "arithmitic over/underflow" error. And it also seems to be keeping the values, ie; if I select "Dollar" and input an amount, but then uncheck "Dollar" and selet "Percent", it keeps the dollar amount in the equation. Hope that makes sense.
    UPDATE:
    Upon thinking further, if I could just have it to where if I was to input a value into the percent box, and there was a value present in the dollar field, it would delete the value from dollar and vice versa that would be great!
    UPDATE 2:
    I have the previous issue solved, but I get the following error
    The only thing I can think is that by default, I have the anualSalary field set to a default of $1.00. It does the calculation correctly, but I keep geting that error. Any ideas?

    Hi,
    the arithmetic over/underflow happens if any of the values used in a script is 0.
    You can wrap you script in a if expression to avoid this problem.
    if (annualSalary gt 0 and percent gt 0) then
         $ = annualSalary / percent / 24

  • Conditional Calculations (IF-THEN-ELSE) - Simple Scenario

    I am referring to the link below:
    http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/content.htm
    For test purposes I have created a simple condition the details are below
    ( ( 'RKF1' <> 'Quantity Total Stock' ) OR ( 'RKF2' <> 'Quantity Total Stock' ) * 1 * 2 )
    In my result set I would expect 1 to appear twice and 2 to appear once.  However, I am only getting 1.  why is this thanks?

    Pradip,
    this relates to Murali's post above, Murali provided this expression.
    You wrote
    +Case 1: Block 1 & Block 2 both are TRUE (Value 1)then
    output = ((1)OR(1)12) = 112 = 2
    Case 2: Both blocks are FALSE then
    Output = ((0)OR(0)12) = 0
    Case 3 : Block 1 is FALSE and Block 2 is TRUE then
    Output = ((0)OR (1)12) = 112 = 2
    Case 3 : Block 1 is TRUE and Block 2 is FALSE then
    Output = ((1)OR (0)12) = 112 = 2+
    Correct is
    Case 1: Block 1 & Block 2 both are TRUE (Value 1)then
    output = ((1)OR(1)12) = ((1) OR (2)) = 1</b>
    Case 2: Both blocks are FALSE then
    Output = ((0)OR(0)12) = 0
    Case 3 : Block 1 is FALSE and Block 2 is TRUE then
    Output = ((0)OR (1)12) = ((0) OR (2)) = 1
    Case 3 : Block 1 is TRUE and Block 2 is FALSE then
    Output = ((1)OR (0)12) = ((1) OR (1)) = 1</b>
    You provided the correct reason yourself: <b>The result is 1 if <Expression1> or <Expression2> does not equal 0</b>. Otherwise the result is 0.
    To achieve your results expression must be (note the brackets)
    ( ( 'RKF1' <> 'Quantity Total Stock' ) OR ( 'RKF2' <> 'Quantity Total Stock' ) ) *2
    =======================================================
    @Murali
    I think I do know why a smart use of addition enables you to model a logical OR without using the boolean expression. But it does not work vice versa - logical OR never becomes an addition.
    Best regards,
    Björn
    Message was edited by: Björn Grahlher

  • Multiple Condition Calculation - New to Numbers

    I am new to numbers and/or excel but what Im trying to do ended up being a lot harder than I thought it should be.
    Im trying to create a summary of items based on multiple conditions
    _ID TYPE # DATE_
    a000001 1 5 Jan 1, 2008
    b000002 7 2 Jan 2, 2008
    a000001 7 1 Jan 3, 2008
    a000001 1 6 Jan 4, 2008
    b000002 1 32 Jan 5, 2008
    c000003 7 6 Jan 6, 2008
    c000003 1 6 Jan 7, 2008
    If ((ID == a000001) AND (TYPE == 1)) then add the # column to the current total.
    OR
    If ((ID == a000001) AND (TYPE == 1) AND (DATE == Jan 1, 2008)) then add the # column to the current total.
    Does that make sense? Ive found may versions of conditional on this forum but I cant find any with running totals.
    Thanks all!
    null

    Bo,
    I'm going to give you a method that you can massage to your liking.
    The E-column may be hidden, and will contain your condition logic. Now E2 contains:
    =AND(A2="a000001", B2=1)
    Column A2 of the Formula Table contains:
    =SUMIF(DataTable :: E, TRUE, DataTable :: C)
    The first argument is the test range, your logic, the second argument is the valid condition for the test range, and the third argument is the range to be summed.
    Jerry

  • Conditional Calculation in Form

    I want to calculate Payee. where we where given a slab
    Taxable amount = 150000
    1st 30000 = 5%
    2nd 30000 = 10%
    3rd 50000 = 15%
    4th 50000 = 20%
    balance = 25%
    please suggest any code how to do this .
    sandy

    Hi Sandy,
    Use this code.
    declare
        taxable_amout number;
        tax number := 0;
        rem number := 0;
    begin
        rem := taxable_amount;
        if rem >= 30000 then
          tax := tax + 30000 * 0.05; -- first 5%
          rem :=  taxable_amout - 30000;
       end if;
        if rem >= 30000 then
          tax := tax + 30000 * 0.1; -- next 10%
         rem := rem - 30000;
       end if;
       similarly extend your logic..
    end;You can store your tax slabs in a table and then store these 30000 etc into variables.
    Hope it helps.
    Please mark answer as helpful / correct, if it helps you
    Navnit

  • Conditional calculating fields

    I have a sticker business, and my customers need to be able to enter dimensions of their stickers.
    Based on the substrate they want, I need to calculate the price based on the total area of the sticker, need add a cutting fee for a circle square or custom shape,
    I cant seen to be able to set up those specifics on my order form.  If this is not possible on this application, I need a refund

    Hi,
    Thanks for asking, FormsCentral currently is not supporting this.
    Regards,
    Perry

Maybe you are looking for

  • Complaints Lack of Customer Service and No respons...

    Hi there I have had very similar experiences. Misold BT Business Line with Braodband speeds. Engineer called and connected to an old second line at the property which would only give me 2 MB. Complained - Nothing Happened BT engineer said that my hom

  • Change XML Namespace in XML

    Hi gurus, i have imported an XSD file as an external definition and use this for a mapping. After my mapping i have an xml file like:   <?xml version="1.0" encoding="UTF-8" ?> - <ns1:Aviso xmlns:ns1="http://Post.AG/PartnerInterface/Schemas/PVSdeAt/Av

  • Firefox often reports it's Offline when it's not. Refuses to load a site.

    On MacBook Pro with OS 10.6, I try to load a site (from a link in a email, for instance . . . or from my own Bookmarks), and Firefox 3.6.13 stops, reporting it cannot load since I'm offline. Which I'm not. Sometimes (usually), when I click File | Wor

  • Steps after CAT2 to transfert personnal cost on WBS (CAT5)

    Hi, After time approuval with transaction CATS_APPR_LITE, I can't go further with CAT5(CAT five) to transfert personnal cost on WBS , because my "personnal nber" wasn't take on the selection with the message :"no data for transfert to PS". What can I

  • New Mac, Old Mac, Time Capsule, Old Airport express

    Hi, I have a couple of questions which I should be grateful if someone could answer: I currently have an "old" mac (latest version of 10.4) and an "old" airport express (latest updates) connected to a modem which forms a basic wireless network with m