Help formula calculation

Hello

Since a few days I tried to figure out how I can make a custom in Adobe Acrobat X calculation script.

All I want is to take the value of a field (Named 'Sub Total') and multiply it by 0.05. It seems so simple, but for the life of me I can't understand. haha

The last script I tried, I found by searching the Help Forums has been:

(function() {}

var v1 = + getfield ('Sub Total') .value;

perform the calculation

var result = (v1*.05);

Set the value of this field on the result result = event.value;

}) ();

But this doesn't make me all that means never.

Any help would be greatly appreciated!

Thank you

Mike

You have not spelled or capitalized method to obtain an object of field correctly. The method is «getField()' not «getfield()»

(function() {}

var v1 = Number(this.getField_("Sub_Total").value);

perform the calculation
var result = v1 * 0.05;

Set the value of this field on the result
Event.Value = result;
})();

Tags: Acrobat

Similar Questions

  • With the help of the previous line in a formula calculator

    Hello.  I use the calculator to create a new string that is a custom filtered version of an existing channel.  Unfortunately, I was not able to identify the entrance of previous line in the channel.  To make things easier, let's say my filter is a simple averager.  This is simple pseudocode for what I want to do:

    New_Channel = (Existing_Channel [n] + Existing_Channel [n-1]) / 2

    where n is the current line.

    It's the calculator formula, with I came:

    ch("[1]/New_Channel") = (CHD (' chnRow - 1 ' [1] / Existing_Channel "") + ch("[1]/Existing_Channel")) / 2 + CTNV (chnRow > 1)

    Unfortunately, I think that chnRow returns 0.

    Of course, I'm a beginner.  I'm open to other approaches to the creation of a new channel with a custom filter.

    Thank you!

    Hi jbuttron,

    What you need to do is to copy the channel and remove the first value of the copied channel then the nth line of the original channel is aligned on the e line (N-1) of the copied string.  You must also add the last value of the string copied at the end of this channel as a new value that both channels end up with the same channel width.  Now you can reference the channels with Ch("[1]/old") and Ch("[1]/new") in the expression of canal's calculator, assuming that the channel names are 'old' and 'new' respectively and both are in the first group.  You need not row variable in the expression now, which is good because there is no way to iterate through a variable row in an expression of canal's calculator.  The iteration of the row is implicit in the reference channel Ch("[1]/new").

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • Backtracing formula calculator

    Hello

    Is it possible to see how a channel has been calculated (formula values when used)? For example, when you use the calculator to create a new channel in a group by multiplying the 2 channels of the same group:

    ("Power") Ch = Ch ("[1] / Revs") * Ch ("[1] / Torque") * 2 * Pi

    Can I "save track" channel newly created in this formula?

    Thank you!

    Hello ZerMahlMeer,

    The only thing I can think is the field 'Description' is stored with the DataPortal channel. It will look like this:

    The 'Description' field will contain the formula used to calculate the channel, and if you save the file on TDM/PDM field will be persistent.

    I hope this helps,

    Otmar

  • Need help for calculation script

    I was instructed to convert an Excel file into a fillable PDF, with formulas and calculations. Unfortunately, I'm a complete newbie to creating forms using calculations and javascript, but so far, I was able to use the built-in functions or to find examples of javascript for the formulas that I am duplicating. However, my final calculation stuck me.

    Basically, I do an if / then calculation based on a field being greater or less than another. If the result is greater, the script should return a 'YES', if it is lower, it should return a 'no' the excel function is as follows:

    = IF(C45>C32,"YES","NO")

    Could someone help me with this script?

    Here is the code for calculating customized to do this, assuming that the names of the other fields are C45 C32 and that their format is set to number:

    c45 var = getField("C45").value;

    c32 var = getField("C32").value;

    If (c45! = "" & c32! = "") {}

    If the two fields are not empty, compare them...

    Event.Value = c45 > c32? "YES": "NO";

    } else {}

    If the fields are empty, reset this field

    Event.Value = "";

    }

  • doubt of formula calculation?

    Hello

    Can we do a database in a form item to store a calculation formula... ?
     
    
    :ITEM_QTY * :ITEM_PRICE
    or we have 2 make poster...!


    Kind regards


    Abdetu...

    An item in a data block doesn't have to be displayed/visible in your form to stored / maintain a value of the formula. Create a test form that displays the field calculation initially so that you know that it's working properly. Set the property of the "Web" with a NULL value for the element, and then add a button that displays the value of the calculated item not shown in a Message(). When you click the button, you will see the displayed value! ;-)

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

    Published by: Silvere on October 29, 2010 08:48

  • Need help on calculation of complex math in labview

    I need help in being pointed in the right direction.  I have an old piece of lab equipment that I have linked to the labview.  In order to send commands to the hardware, I have to calculate a checksum.  The checksum algorithm requires me to take alphanumeric, convert them to binary, perform a binary addition, perform an Xor, hide some numbers and convert the resulting binary string to an ascii character.  LabVIEW has the capabilities to do it on its own, or should I look for to connect to something like an external dll?

    I have Visual Studio 2008 and some previous experience in VB, so I think I could write a program that would make the calculation, but don't really know exactly what kind of project (dll, etc.) is preferable.  Are there specific for the dll parameters so that labview can use it.  I see an example for C++ to Visual Studio 2005, but that's as close as I can get.  I only know VB, c#, or C++

    Can someone tell me please in the right direction?

    Tron

    You essentially have some quarters of logical work and ANDS.

    Check version 2.

    /Y

  • Help in calculating risk rating

    I am trying to understand the calculation of the risk on a sensor of IPS4240 scoring.  From what I can tell, it seems that there are a few additional settings added to the equation that are not easy to determine.  It looks like the (attack relevance Rating) ARR and/or WLR (Watch list Rating) are changes (e.g. added to the RR), but I can't find all the values for these.  There are default values for RIOS, who uses the system?  What of the WLR can be seen everywhere?

    Any help is appreciated.

    Thank you

    Pat

    Hi Pat,

    I guess that below, that's what you're looking for:

    http://www.Cisco.com/Web/about/security/intelligence/ipsmit.html

    It says the following:

    "Attack relevance of note: the relevance of note (ARR) attack is a value that indicates whether the target of the attack can be vulnerable to an attack specific to the event that is generated by the IPS.".  This information is normally collected through passive identification of operating system but can also be set by a user or collected in the course of integration with the Cisco Security Agent Management Console. If you don't know the operating system of the target device, there is no change in the level of risk.  However, if the operating system of the target device is detected as relevant, the level of risk increases by 10 in Inline and Promiscuous mode. If the operating system of the target device is considered to be irrelevant, the level of risk in Promiscuous mode is reduced by 10, and no change occurs in Inline mode. »

    Let me know if this clears things up to the top.

    Thank you and best regards,

    Assia

  • More help with calculations

    Hello

    I have the first part of my form to work with a subtotal field S1.  Now, I want to calculate a discount in field D1 if S1 is greater than 200.  I put

    If (S1 > 200); D1 = 0.1 * S1

    Else D1 = 0

    In the JavaScript editor, but I get a syntax error (Missing; before instruction 2 to line 3).

    I put in addition to the semicolons, but still not the error.

    I have a book of Java Script, but it does not seem to cover this problem.

    Help, please.

    Thank you

    As I thought, you were away... You should use this code:

    var S1 = Number(this.getField("S1").value);
    if (S1>200) event.value =0.1*S1;
    else event.value = 0;
    

    You must also change the order of calculation of field and make sure that S1 is calculated after the fields of line (T4, T6, T8) totals, after S1 D1 is calculated and the G1 is after all of them.

  • Help formula of ASO Urgent...

    Hi Experts,

    I have fomula Member that contains the actual value or budget based on the actual load. Formula works well as expected however the aggregation does not.

    Member name: forecast (Abs) (25 of solve order)
    -case when islevel ([time] .currentmember, 0) then (case when IsEmpty ([PY_PER]) and IsEmpty ([PY_PER_REVENUE]) and then ([last budget year (Abs)]) else ([last year (Abs)]) end) END

    Member name: prediction Test (30 of solve order)

    CASE WHEN IsLevel ([time] .currentmember, 0), THEN [SEE]. [Forecast (Abs)] else (sum ([Time]. CurrentMember.Children, [VIEW]. [Forecast] (Abs))) end

    The above formula is rolling only level months but months level value is not aggregate level qtr and qtr to the level of the year.

    Our temporal dimension is multiple hierarchy enabled. Primary hierarchy is Power (year-> week-> date) and secodary is exercise (year-> qtr-> month-> date (shared)).

    Any help is appreciated.
    Raja Mohamed

    Hello Mohamed,

    I think the problem is in

    sum ([Time]. CurrentMember.Children

    That is why the month working and probably the week also works. Maybe you have to work with descendants, and not just take the kids. It is dynamic, so the year children are quarters and they have no data because it is stored at lev0.

    Kind regards

    Philip Hulsebosch

  • Help custom calculation

    I need help to write a custom calculation.  That's what I need: I have four boxes (Tone4, Tone1, Tone3, Tone2).  Each box is worth its value (ie. If Tone4 is activated, it should give me 4 points).  How can I write a script that will give me the right value for the checkboxs?

    Tone2 Tone1 ToneScore Tone3 Tone4

    x                                                            4

    or

    Tone2 Tone1 ToneScore Tone3 Tone4

    x                                             3

    or

    Tone2 Tone1 ToneScore Tone3 Tone4

    x                               2

    or

    Tone2 Tone1 ToneScore Tone3 Tone4

    x               1

    or

    Tone2 Tone1 ToneScore Tone3 Tone4

    0

    Why these boxes are named differently? If they are part of an exclusive group (that is to say, you should not check more than one at a time) then they should have the same name but different export values. Then, you can simply set the desired values as the values of export for each box and use this code as the custom calculation of ToneScore script:

    Event.Value = this.getField("Tone").value;

    If (event.value is "Off") event.value = 0;

  • Help formula ASO MDX

    Hello

    How can be function @ISMBR be translated MDX for a specific list of members? For example, how can we the BSO (@ISMBR("Jan","Mar","May","Jul","Aug","Oct","Dec")) converted to ASO formula?

    Any help is appreciated. Thank you!

    You will use the IS for a single member function and the function CONTAINS several members

    CONTAINS ([point]. CurrentMember, {[Jan] [Mar], [May] [Jul] [Aug] [Nov] [Dec]})

  • Help formula ASO MDX contour

    I am trying to build a formula for contour ASO which does the following...

    If year < & months and those < & CurrentMonth

    then the value A value of B account
    another account set A = C

    Those CurrentMonth are variables of subs and year and month are in the format of fiscal 2011/Jan. If the substitution variables can be used, is it possible to use the today() function?

    Please help with MDX equivalent.

    I don't think that will work but try this one

    case
    When contains ([year]. CurrentMember, MemberRange ([FY2009], [FY2010]))
    then B
    When IS ([year]. CurrentMember, & those) and contains ([point]. CurrentMember, MemberRange([Jan],&PreviousMo))
    Then
    B
    on the other
    C
    end

    and let me know the result

    Kind regards
    RSG

    Published by: RSG July 21, 2011 16:41

  • Help with calculation

    Hello

    I have a calcualtion with Infinity negative result (in.fin.ity.00).

    I try to use isNaN (calculation) for validation, but does not work.

    tempCal = myCaculation

    If (isNaN (tempCal)) {}

    finalCal = 0;

    } else {}

    finalCal = tempCal;

    }

    How can I validate this result?

    Thanks in advance.

    Best,

    Refer to the API of thinning of the function: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/package.html#isNaN)

    A nonzero when number divided by 0 entered isNaN return is false (even if you wait this is true since traces of result as "infinity").

    The original question is a little vague, but the way I understand it, there is no need to try-catch.  This should work:

    If (isFinite (YOUR_NUMBER) &! isNaN (YOUR_NUMBER))

    {

    If YOUR_NUMBER is over and he is NOT NaN... you are here.

    }

    on the other

    {

    Otherwise, YOUR_NUMBER is either infinite or NaN...

    }

  • Help formula MDX: the months for every month

    Newbie here and young developer Essbase. My business more or less left me on my own without any training, so I'm here hoping a kind soul will help me with a formula. I've got 9.3 Essbase. The cube, I'm working on that is ASO so that the code is in MDX.

    Asked me to build a 'net growth' formula that displays the current month in the variance of the previous months to every 12 months at a time for a given account. Ideally, the user would choose the 'net growth' Member for a given month and be able to see the gap for the previous month dynamically and the variances would be additive to the quarters, et al. I don't need a member formula that allows users to see only the variance to the previous month, or a formula that is attached to the only current month. There is an example below of what I consider the dataset to look like.

    Here are my questions: I was able to get the piece of net growth from month to month to work perfectly, but (a) I can't think of a way to encode the variance from January to December avant-annee or (b) how to get variances to be additive to the quarters and etc.

    So far, my code is based on my Sun account and is the following: account - (account, periods. CurrentMember.PrevMember)

    Example:
    ............ Real... Net growth
    Dec... 8100
    Jan... 8000-100
    Feb... 9000... 1000
    Mar... 8500...-500
    1ST QUARTER... 8500... 400
    Apr... 8750... 250
    May... 8900... 150
    Jun... 9100... 200
    Q2... 9100... 600

    Here's a quick overview of some of my dimensionality and other facts:
    Time elements are divided into four
    1 dim scenarios (for example actual, budget, variance) the order of resolution 15 (although the majority of members are Dim solve 35)
    2 periods (month, quarter, year) Sun 20 of the order of resolution
    3 years (e.g. AFA 08)
    4 views (i.e. MTD, QTD, CDA) Sun 30 of solve order

    I build the formula of "net" on an account that is the last time balance. The account in question is not an expense account, so there is no If/Then logic or from the UDA in this regard.

    Any input at all would be greatly appreciated I'm pretty stuck at this point. Thanks in advance to anyone who is willing to help.

    Published by: user7747563 on October 8, 2008 12:01

    My account.dec was a typo. It should have been a coma.

    I misread your initial statement. Because this account is not balance time then you don't need the or statement. I thought you wanted the time balanced qoutput. You could add an islevel for your case statement change the other to another case and the final one would be the sum of children

  • Help formula: count the number of whites in a column "up to the...» »

    name string metric
    Matthew 5
    brand 1
    brand optimusPrime
    brand
    Luke 2
    Matthew jamesLikesSteak
    John 3
    Luke lukingGood
    Matthew
    Luke
    John johnnyPop
    John

    Hey guys - so I do business with a bit of a problem in number. I have a number table - the table above is a simplified representation of the corresponding parts of the table. The left column 'name' is a series of 12 names repeated and 0 missing values. The "string" middle column is a column that has a lot of missing values by a formula based on another column that is not relevant to this problem. Who is not missing is all strings. The problem I have is in the 'metric ': right column

    I am trying to create a dynamic formula which will result in the numbers and blanks, exactly as above. My goal is to create a formula that, for each line, account the number of whites in the column 'chain' until we reach an empty 'string' which occurs next to "namesake" as in the line of housing the formula - and if there is no such a situation, so that it is empty. For example, if the second row (including header row) bears the name of "Matthew". The next time that a white 'string' occurs next to the name "matthew" is tenth. The number of whites that occur between the second row, and the ninth is 5 (lines 2, 3, 5, 6 and 8). I manually coded a small part of the table to use something like this (which would be installed in cell C2 in this example):

    = IF (B2 = "", COUNTBLANK(B2:B9), "")

    This formula produces the correct number for the first row of data (5), but it does not dynamically fulfill what I'm trying to do this since I am currently having the formula to find the next blank 'chain' that occur next to "name" in the formula line.

    I hope that someone has encountered anything like this before. I tried to go through all the functions and numbers from formulas, but so far I have not found much success.

    Hi BaronDe,

    I need to ask, "why you try to do this? So what you want is possible it will be a complex solution. It may be much easier to get your information in a different way. Indicate these blanks?

    You should know that COUNTBLANK() will not count a cell with a formula, even if this formula resolves to «»

    Quinn

Maybe you are looking for