Conversion of excel in the calculation script formula

How to convert this excel formula in the calculation script in pdf format?

= IF (K10 = "PRF1120", 13, IF (K10 = "PRF1020", 10, IF (K10 = "PRO1020", 8, IF (K10 = "PRF1140", 5, IF (K10 = "ACC 1020", 3, IF(K10="PRO1080",4,""))))))

The custom calculation script should be something like:

Get the value of an input field

var sVal = getField("K10").valueAsString;

Set the value of this field depnding on the value of the input field

switch (sVal) {}

case 'PRF1120 ':

Event.Value = 13;

break;

case 'PRF1020 ':

Event.Value = 10;

break;

Repeat for the other possibilities

by default:

Event.Value = "";  This field blank

}

More information about the JavaScript statement switch are available in any decent JavaScript reference. Replace "K10" in the first line above with the actual name of the input field.

Tags: Acrobat

Similar Questions

  • How to use the @accum function in the calculation script

    Dear all.

    I'm new in essbase - calculation script so don't know how to use the @accum function.

    I want the aggregation value of child to parent

    Hierarchy

    Product

    100 > Storage Dimensions marked as stored (marked as intentionally as I want to calculate the value using the calculation script)

    100. 10 (+)

    100-20 (+)

    100-30 (+)

    I'm trying calculation Script

    100 = @Accum (@children("100"), jan: Feb);

    It works when I use below

    100 = @Accum("100-10",Jan:Feb);

    Error:-number of Dimensions [1] does not match number of gen/lev [3] office [@Dim]

    Don't know how I can roll up to an aggregate value of all the members of the child to the parent.

    Error.PNGhierachy.PNG

    you do this more difficult it must be. If you want to accumulate up to 100 then you could just make your calc

    '100 '.

    but that would be only 100, to make the OU any dimension would

    AGG (Product);

    Or better yet

    AGG (Product, Market);

  • Using the calculation script to write the value of the variable Substitution in a file

    Hello

    I am trying to use the calculation script to write the value of Substitution variable in a text file.
    I use the dataexport command. But it is not able to write values in the text file.

    Any help is appreciated.

    Thank you.

    MaxL would display variable. See: http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/html_esb_techref/maxl/ddl/statements/dispvarb.htm

    BTW, I mostly prefer Esscmd MaxL. I think that makes me a heretic, but I don't understand why I don't want to type more rather than less to get the same result.

    Running a calc:
    Esscmd - RUNCALC 2 calcname
    MaxL - run calculation Sample.Basic.calcname;

    To be fair, Esscmd requires a dbname appname SELECT before the RUNACALC, but it is always less striking.

    However, time is running, so I don't have too. And of course, MaxL now has many things that Esscmd doesn't like Esscmd is obsolete.

    I always use Esscmd to run scripts of calc I can actually watch the output in real time as opposed to MaxL that exports the console at the end of execution.

    Kind regards

    Cameron Lackpour

  • CDA & QTD calculation using the calculation Script

    Hello

    I named 'Periodicity' in my Essbase database, which has 3 members under the name "BAT", 'QTD' & 'CDA' dimension.
    I'm figuring "CDA" & "QTD" and I wrote following script for the calculation of the "CDA":

    DIFFICULTY)
    @GENMBRS ("VFS planning Dimension entity", 6);
    @GENMBRS ("VFS planning Dimension entity", 7);
    & CurYear,
    @LEVMBRS ("P & L", 0);
    "Local."
    "CDA",.
    "HSP_InputValue,"
    @CHILDREN (the ' scenario Dimension'),
    @CHILDREN ("Dimension" version)
    )

    "Jan" ="BAT"-> "Jan";
    "Feb" ="BAT"-> @PTD("Jan":"Feb");
    'Mar ' =' BAT'-> @PTD("Jan":"Mar");
    "Apr" ="BAT"-> @PTD("Jan":"Apr");
    "May" ="BAT"-> @PTD("Jan":"May");
    "Jun" ="BAT"-> @PTD("Jan":"Jun");
    "Jul" ="BAT"-> @PTD("Jan":"Jul");
    "Aug" ="BAT"-> @PTD("Jan":"Aug");
    "Sep" ="BAT"-> @PTD("Jan":"Sep");
    "Oct" ="BAT"-> @PTD("Jan":"Oct");
    "Nov" ="BAT"-> @PTD("Jan":"Nov");
    "Dec" ="BAT"-> @PTD("Jan":"Dec");

    ENDFIX

    However, the above script gives me following error:

    [Error: 1200354 error compiling formula [Feb] (line 22): type [MEMBER] [number] ([@PTD]) in function]

    Please help me with this calculation "CDA" & "QTD.

    Thank you and best regards,

    AK

    Yep, I missed that...
    but you can get by using the @sumrange function.

    DIFFICULTY)
    @GENMBRS ("VFS planning Dimension entity", 6);
    @GENMBRS ("VFS planning Dimension entity", 7);
    & CurYear,
    @LEVMBRS("P&L",0),
    "Local."
    "HSP_InputValue,"
    @CHILDREN (the ' scenario Dimension'),
    @CHILDREN ("Dimension" version)
    )
    datacopy mtd to CDA.

    Fix (YTD)
    "Feb"=@sumrange(MTD,"Jan":"Feb");
    "Mar"=@sumrange(MTD,"Jan":"Mar");
    "Apr"=@sumrange(MTD,"Jan":"Apr");
    "May"=@sumrange(MTD,"Jan":"May");
    "Jun"=@sumrange(MTD,"Jan":"Jun");
    "Jul"="@sumrange(MTD,"Jan":"Jul");
    "Aug"=@sumrange(MTD,"Jan":"Aug");
    "Sep"=@sumrange(MTD,"Jan":"Sep");
    "Oct"=@sumrange(MTD,"Jan":"Oct");
    "Nov"=@sumrange(MTD,"Jan":"Nov");
    "Dec"=@sumrange(MTD,"Jan":"Dec");
    endfix
    endfix

    Alternatively, you can use as follows:

    DIFFICULTY)
    @GENMBRS ("VFS planning Dimension entity", 6);
    @GENMBRS ("VFS planning Dimension entity", 7);
    & CurYear,
    @LEVMBRS("P&L",0),
    "Local."
    "HSP_InputValue,"
    @CHILDREN (the ' scenario Dimension'),
    @CHILDREN ("Dimension" version)
    )
    datacopy mtd to CDA.

    Fix (YTD)
    "Feb" = Jan + Feb-> MTD;
    "Mar" = Feb + Mar-> MTD;
    "Apr" = MAR + APR-> MTD;
    "Peut" = APR + may-> MTD;
    "Jun" = May + June-> MTD;
    "Jul" = June + July-> MTD;
    "Aug" = July + August-> MTD;
    "Sep" = August + Ms-> MTD
    "Oct" = Ms + Oct-> MTD
    "Nov" = Oct + Nov-> MTD
    'Dec' = Nov + Dec-> MTD
    endfix
    endfix

    -Krish

    Published by: Krish on August 9, 2010 16:41

  • How to make the calculation script to show 2 decimal places and stop rounding down to integers?

    Hello. First of all, thank you to those of you who have helped me create an interactive PDF file last year that worked perfectly if only integers are entered. This year, my client wants to show two decimal places in the calculations, and I'm back in this forum hoping to find the same expertise to make it happen.

    My form includes 43 fields for various monthly expenses. The sign of dollar for each field is part of the content of the form, not part of the scope of formatting. Users enter values directly in these fields, and the fields are formatted to display two decimal places. Each of these includes a the following validation script:

    Event.RC =! (event.value & & + event.value < 0);


    To the right of each of these fees, the fields are yes/no boxes ( expense Typecalled) that answer the question, "is this essential expense? The value of exports for Yes's 'essential', and the value of exports is "discretionary".


    A value entered in all areas of expenditure is directed to the field Total expenses by checking Yes or field Total discretionary spending by clicking No. two of these total fields are formatted to display two decimal places. In addition to long calculation scripts, the two totals fields include this custom validation script:

    If (event.value == "0") {event.value = util.printx ("", event.value)}

    Here's the problem: when values with two decimal places are entered in any area of expenditure, the calculation in two fields of total script rounded to the whole number closest. When 10.99 is entered in a field of expenditure and the Yes checkbox is checked, the value 10.00 is displayed in the field Total expenses . I want to display 10.99.

    For testing purposes, I inserted a new text field and did a simple calculation in choosing the fields of the somme and the values displayed correctly. The problem is definitely with the script in the two fields in total .


    I can drop the scripts of math here, but they are long and I'm not sure what the Protocol is super-long positions. I could also download the file, but I never did it and will need to understand this.

    Thank you for taking the time to read this. If you can help me, very well!

    To explicitly convert the field values for numbers, do something like this instead:

    var expense0 = + getField('monthly$.0').value,

    depenses1 = + getField('monthly$.1').value,

    etc.

  • Reg: using dynamic calc in the calculation script

    Can we use Sylvie calco sparse dimension member in a calculation script. In what situations, we use intelligent calculation and in what situations, we only use intelligent calculation.

    Generally, you disable smart calc for manual calculation scripts, you want to run. Intelligent calculation means that "If you then load a subset of the data, on subsequent calculations, Essbase calculates only the blocks of data that have not been calculated and calculated blocks that require a recalculation because of new data".

    Taken directly from: http://download.oracle.com/docs/cd/E12825_01/epm.111/esb_dbag/dcaoptic.htm

  • Send alerts by e-mail of the calculation scripts

    Hello

    I heard that it is possible to send an e-mail notification in calculation scripts, so after some research online, I came across some information on how to do it. There is an old thread in this forum about this, but I couldn't make it work.

    Here's what I know:

    -

    There are two things you can find.
    1. the triggers
    2 alert cdf

    the alert is a custom definde function that will do what you want that trigers send emails based on conditions

  • Problem with the calculation script - dividing one field (a number) but another field (a number that corresponds to a sum of other fields)

    I have a table that contains the users to enter the number of books in a type of food (Fruits & vegetables, products dairy, protein, grains, etc.). There are 8 fields whose amounts are totaled in a field (PoundsTOTAL) using the calculation of "value is the sum...". ».

    The question that I am running is that for each type of food, there is also a percentage field that indicates the percentage of the total books that represents the type of food. If I used the simplified field notation (PoundsDairy / PoundsTotal * 100) I get the dreaded "the value entered does not match the format of the field" because the PoundsTOTAL field is 0 until someone between numbers in the fields above him. I tried using the code I found on this forum, but it does not work for me (I do not know I did something wrong). I enter a number like 500 in the field of the PoundsFV and the PercentFV field shows nothing.

    Here is the code I use for one of these calculations:

    (function () {}

    Get the field values as numbers

    var lbsfv = + getField("PoundsFV").value;

    var lbsttl = + getField("PoundsTotal").value;

    Perform the calculation and the value of this field will cause

    If (lbsttl! == 0) {}

    Event.Value = lbsfv / lbsttl;

    } else {}

    If lbsttl = 0, this field blank

    Event.Value = "";

    }

    })();

    For reference, the referenced fields are shown in this image:

    .FormCalcs.jpg

    Your domain is named PoundsTOTAL, not PoundsTotal.

  • Form user entered in the calculation scripts

    I was asked if it is possible to create a LiveCycle form where users can click into a field, add or subtract various amounts (they can apparently in Excel by entering a formula with the corresponding amounts, for example "= 2.54 41.87 + 14.62'"), then, in addition to seeing the total resulting, they also want to be able to see the items that have been added/subtracted that is to say the work! Is it even remotely possible in LiveCycle?

    OK, first let me say with irony that I kind of hate to ask this question... It ruined my brain any longer that it should have.

    I could get this to work with the main 4 operators (+, -, *, and /) in order. I have not tried to apply the order of operations because it would be worse still. (Should be recursive operations that I'm not really interested in trying to remove in LC right now).

    Here's the code for that work as well as some screenshots of what it looks like. If an operator is the first character, the event performs any operation on the existing subtotal, removes the operator and number, then loops back if it is more remains to be done.

    Screenshot of work text field for the field equation and decimal for the answer:

    Screenshot of the design with a code view:

    All of the code in the output field. (I am sure others could simplify this a little more, but that's what I came with.) Also, I apologize if the fingerprints are not fair. Syntax highlighting is a stupid idea. :

    
    var f = this.rawValue;
    var subtotal = operatorIndex = 0;
    var opEx = /\+|\/|\*|\-/;
    do{
      switch (f.slice(0,1)){
        case "+":
          f=f.slice(1);
          operatorIndex = f.search(opEx);
          if (operatorIndex > -1) {
            var addend = parseFloat(f.slice(0,operatorIndex));
            f=f.slice(operatorIndex);
          }
         else {
           var addend = parseFloat(f);
           f=null;
         }
         subtotal = subtotal + addend;
      break;
      case "-":
         f=f.slice(1);
         operatorIndex = f.search(opEx);
         if (operatorIndex > -1) {
           var subtrahend = parseFloat(f.slice(0,operatorIndex));
           f=f.slice(operatorIndex);
         }
         else {
           var subtrahend = parseFloat(f);
          f=null;
         }
         subtotal = subtotal - subtrahend;
         break;
      case "/":
        f=f.slice(1);
        operatorIndex = f.search(opEx);
        if (operatorIndex > -1) {
          var divisor = parseFloat(f.slice(0,operatorIndex));
          f=f.slice(operatorIndex);
        }
        else {
          var divisor = parseFloat(f);
          f=null;
        }
        subtotal = subtotal / divisor;
        break;
      case "*":
        f=f.slice(1);
        operatorIndex = f.search(opEx);
        if (operatorIndex > -1) {
          var multiplier = parseFloat(f.slice(0,operatorIndex));
          f=f.slice(operatorIndex);
        }
        else {
          var multiplier = parseFloat(f);
          f=null;
        }
        subtotal = subtotal * multiplier;
        break;
      case "=":
        f=f.slice(1);
      default:
        operatorIndex = f.search(opEx);
        if (operatorIndex > -1) {
          subtotal = parseFloat(f.slice(0,operatorIndex));
          f = f.slice(operatorIndex);
        }
        else {
          subtotal = f;
          f=null;
        }
        break;
    } while(f!=null);
    nfAnswer.rawValue = subtotal;
    
  • Global fix to the calculation Script

    Hello

    This thread is not a problem but a question. I saw this thread (DIFFICULTY on a UDA where Todd shouted question with the help of Global trouble. I don't know what problem being called.

    I have a huge script that uses only 4 dimensions (on 13) through the script. So easy to maintain and also limiting the DB pass, I fixed 9 dimensions at the beginning and have small corrections to the other 4 dimensions. It is not optimal? Is there another way that I think not?

    Thank you

    Nitin

    It is difficult to read this post because he had the modification of messages after the fact (oh, controversy is fun).

    What I think has been referred to as a 'global solution' was when SET EMPTYMEMBERSETS ON did not exist in the environment of the OP. Without the empty member treatment on Essbase will deal with EVERYTHING. It's quite exciting in a bad way. And is kind of overall fix-on-everything. At least that is what I think it means.

    FWIW, I (and others) found to be quite particular about the use of EMPTYMEMBERSETS. See this post:
    http://camerons-blog-for-Essbase-hackers.blogspot.com/2012/10/stupid-programming-tricks-14-set.html

    Kind regards

    Cameron Lackpour

  • Error 1200345 on the calculation script

    Hi all
    I use the following formula
    'profit' = ' Total net '-'Sales ';
    and Iam getting the following error message:

    Error (1200354) - error compilation formula


    Can someone give valuable information above me on what?

    Thank you
    pp

    Hello

    One solution is to save the contour and re - open again.

    KosuruS

  • Width height in the calculation script

    Hi, I want to script to compare all layers in psd with photo with width and height IE one background of psd is open script will read the value of the layer as Photoshop PSD, whether portrait

    or landscape somehow tell by its width and height if the height is greater than width than his portrait vice versa and then compare with photo by opening it in sequences or first it will read the value of picture to compare with layer.if there me even instead of landscape, and to place was same , then it will perform action otherwise it will again open psd.and with compare same photo

    You don't need a new script.  All you need to do is create a template PSD adhering to my four rules. They are very simple.

    The four rules:

    1. Models of photo collage for the desired print size - width and height of the size and DPI print resolution.
    2. Photo collage templates must have a background layer in Photoshop. The content of this layer can be anything.
    3. Photo collage templates must have alpha channels named "Picture 1", "Picture 2"... "Picture n".
    4. Photo collage templates layers above the background layers must provide transparent areas to reveal the images which will be placed below them.

    We do not just pop out a script complex. Peek at my scripts with a text editor, there are a lot of design and programming involved.  I don't have no idea of what size and resolution you want your collage to have.  Also, I have no idea what are the elongation of your images.  With this knowledge, it should take only a few minutes to create a model 10 for sure.

    I created a template for you last example using size 30 "x 12" at 200 dpi and 6 images of different aspect ratio. There are still a few tilt in the image 3 and 5.  You can download the template http://www.mouseprints.net/old/dpr/6images.psd

    I've only used a background layer.  I don't have add and upper cover layer however the alpha channel, I created for image 6 will allow some of the background show through the image 6.  Here is a screenshot with the template in Photoshop and including a populated version. Also just copy my scripts in Photoshop Presets\scripts folder and use Photoshop in the menu file > Scripts > selected My Script. The Toolbox extendedscript has problems with some things.

  • Is it possible to use formulas (for example 'if' or VLOOKUP functions) in the "custom calculation Script?

    I'm working on a PDF form fill converted from MS excel. It is for others to use who do not have MS excel required to use my spreadsheet.

    1. I would like to know, how can we have complex formulas being the custom tab calculation script calculate under properties in a menu of cell?

    2. where can I find it that the formulas will work in the calculation script custom as well as the format of these formulas work properly (tutorials would help)?

    I tried to write an 'if' function but I get and error so I guess that is functions do not work in the script, or there is a different format of spreadsheet standard formats.

    Bruce

    .

    In this case the loop would be:

    for (var i = 0; i)< 8;="" i="" +="1)">

    sum += + getField("Total."_+_i).value;

    }

    So initially, the counter i is zero, so the domain name used with the getField method is:

    'Total': + 0, which results in the string "Total.0". At each iteration, the variable i is incremented by 1, so the following field names are the following:

    "Total.1".

    "Total.2".

    'Total.3 '.

    'Total.4 '.

    'Total.5 '.

    'Total.6 '.

    "World.7.

    The script gets the value of each field, it converts numbers and adds the number to the cumulation.

  • the difference between the form of Member or a calculation Script?

    Hello
    I am going through some assignments. Here I observerved in essbase we can do the calculation using the calculation Script or a member form.

    I know, Member we can write to any Member, it is only for that perticular in outline and stored in outline members. and calculation for any database stored Extornally script.

    A fully written BSO formula was 1242 lines and i.e.formula 75 493 bytes size less than 64 KB. It is the limitation of the formula of Member, is their any other difference apart from that, because of this we can use the calculation on the Member form script or if anything else, so, please let me know.


    So could you tell me:
    When use the formula of Member and what is the advantage of the Member, or when to use the calculation for calculation script?

    What is the best option that I'll go for formula script or calculation of Member?

    A few comments based on the response of SS1988.
    1 unary (contour) calculations are the fastest type of calculations.
    2 many if not most of the formulas of Member are performed on dense dimension as dynamic calculations (and sometimes sparse dimensions) these work really well especially for type ratio calculations where you would have to calculate at each level of the database. The best formulas will make only reference members in the same block because they are quicker to run. Complex formulas can be slow.
    3. calculation scripts you give the most flexibility you can do calculations procedures (followed by B Calc calc A do) and you can limit the scope of a calculation using the patch and if statements

  • The Script for the calculation of the Vs Web planning security

    Hi all

    I loaded a few accounts one read access to planning and these accounts are calculated by the calculation script. So if the user starts the calculation script will run even if I read access assigned to members in web planning? Read in planning web access has no control over the data which are calculated via the calculation script?

    Please advise!

    Hello

    Why don't you just use of rules of business instead of calc scripts, you have added security and can limit the calculations for what's on forms using variables.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

Maybe you are looking for