How the sum of a series of if Athens?

Given:

Image.jpg

I need adding the cost of reception (PM01) breakfast (Cost01), reception cost (Cost02) and lunch cost of reception (Cost03).

If the cost of each receipt exceeds each meal allowance, use value meal in sum compensation.

If the cost of each reception is less than or equal to each value of the meal allowance, then use the cost of reception in all.

You can use a calculation script customized to the field which displays the sum, something like:

Custom calculation script

(function () {}

Get the field values as numbers

var v1 = + getField("Cost01").value;

var v2 = + getField("Cost02").value;

var v3 = + getField("Cost03").value;

Add the eligible amounts of breakfast, lunch and dinner

and set the value of this field

Event.Value = Math.min (v1, 12) + Math.min (v2, 17) + Math.min (v3, 27);

})();

Tags: Acrobat

Similar Questions

  • How the SUM cells including the text and the number?

    Hello world

    Someone can tell me how the SUM cells include the text and the number?

    1 Bob 20

    2 30 Jane

    3 50 Jame

    Total 100

    Thank you

    Hi Jordan,.

    If the numbers are not always two digits, FIND the position of the space between the number and name:

    Formula in B2 (fill down)

    = FIND("",A2)

    Then use the LEFT function to get the number in the column C:

    Formula in C2 (fill down)

    = LEFT (A2, B2)

    This will give a text string (Tip: left-aligned).

    Convert to a numeric value in the D column with the VALUE function:

    Formula in D2 (fill down)

    VALUE = (C2)

    (Tip: propped right)

    Table 1 has a header row and footer of the line, and the SUM is easy. Formula to the D8 footer line:

    = SUM (D)

    Kind regards

    Ian.

    Edit: You can hide columns B and C

    Ian.

  • How graphic how the sum of several metrics of in a dashboard.

    I'm looking to find out how the graph of the sum of multiples of the metric, as CPU ready, or latency of disk in one graph on a dashboard / report.

    An example would be showing collective management s VM in balloning of CPU and memory of the pool on line on a chart.

    Thank you!

    If you want the chart to reflect everything that you can do the stacking graphics option which will be sleeping all values.

  • SQL - how the sum on specific lines

    Hello

    Forever, the line, I want to show MySQL for previous lines, only when the previous values are equal = 1,.

    and only for successive lines.

    for example, the result expected on the column 'result '.

    Result of ID value

    100 1-

    130 1 2-> (current 1 + pre 1)

    3 500-

    1 600-

    2-1-700-> (current 1 + pre 1)

    1000-1-3-> (current 1 + precedent1 + 1 previous pre)

    4 1 1200

    How can do us it easily?

    I thank everyone in advance.

    Here's a way...

    with t (id, value) :)

    Select 100.1 in union double all the

    Select 130.1 Union double all the

    Select 500,3 Union double all the

    Select 600,1 Union double all the

    Select 700,1 Union double all the

    Select 1000,1 Union double all the

    Select double 1200,1

    )

    Select

    ID

    value

    case

    When start_of_group = 0 and = 1 value

    then MySQL over (partition by group_num by id order)

    Another null

    end result

    de)

    Select sum (start_of_group) (any order by id) as group_num

    start_of_group

    id

    value of)

    Select

    case

    When lag(value,1,0) (any order by id)! = 1 then 1

    0 otherwise

    end as start_of_group

    id

    value

    t

    )

    )

    order by id

    ;

    Kind regards

    Bob

  • calculation of ratios and rounding - how the sum of last record to give 1

    I'm putting in a single query to calculate the reports for an unknown number of records. I want to turn the ratios to 5 decimal places and I want the total reports of equal to 1.

    for example

    If I have 3 folders with Qty total overal 4,5,6 is 15
    I note 3 lines
    Round (4/15.5),
    Round (5/15.5),
    Round (6/15.5)

    but I want to ensure total = 1
    so I will try to do something like

    Round (4/15.5),
    Round (5/15.5),
    1 - round(4/15,5) - round(5/15,5)

    can someone help show me the sql construction? I've been trying and failing using where clause

    of course this example would add to 1 but other unknown ratios may not match up to 1.

    Published by: user12154024 on November 2, 2009 22:32

    Hello 12154024,

    Welcome to the forum. May not be a more elegant solution, but it shows how it works step by step

    WITH t AS (
    SELECT 4 n FROM dual
    UNION ALL
    SELECT  5 n FROM dual
    UNION ALL
    SELECT 6 n FROM dual
    )
    ,t1 AS (
    SELECT  n
           ,ROUND(RATIO_TO_REPORT(n) OVER (),5) AS rr
           ,COUNT(n) OVER () AS c
           ,ROW_NUMBER() OVER (ORDER BY n) AS rn
    FROM    t
    )
    ,t2 AS (
    SELECT  n
           ,rr
           ,SUM(rr) OVER (ORDER BY n) s
           ,c
           ,rn
    FROM t1
    )
    SELECT  n
           ,rr
           ,CASE WHEN c = rn THEN
                rr + (1 - s)
            ELSE
                rr
            END rr2
           ,s
    FROM    t2
    ORDER BY rn;
    
    N   RR        RR2       S
    --- --------- --------- --------
    4   0.26667   0.26667   0.26667
    5   0.33333   0.33333   0.6
    6   0.4       0.4       1        
    
    3 rows selected
    

    The part "WITH t AS" generates data
    T1 calculate the ratio, counts the number of records and signs a current issue
    T2 to calculate a cumulative ratio
    the last part takes these data and for the last record (number = count running) it allows to adjust the ratio.

    You can see if you are using other data

    WITH t AS (
    SELECT 4.78 n FROM dual
    UNION ALL
    SELECT  5 n FROM dual
    UNION ALL
    SELECT 6 n FROM dual
    )
    ...
    
    N    RR       RR2      S
    ---- -------- -------- --------
    4.78 0.30292  0.30292  0.30292
    5    0.31686  0.31686  0.61978
    6    0.38023  0.38022  1.00001  
    
    3 rows selected
    

    Concerning
    Marcus

  • How the sum of these two tables?

    Hello

    I have two tables

    DESC ACTIVITE_EXCEP_FAITE

    NUMBER OF FICHE_ID

    NUMBER OF SERVICES_ID

    NUMBER OF ACTIVITES_EXCEPTIONNELLES_ID

    NUMBER OF TIME

    NUMBER OF ACTIVITE_EXCEP_FAITE_ID

    DESC ACTIVITE_FAITE

    NUMBER OF FICHE_ID

    NUMBER OF ACTIVITES_ID

    NUMBER OF SECTEURS_ID

    LENGTH NUMBER (8.2)

    NUMBER OF ACTIVITE_FAITE_ID

    NUMBER OF TYPE_ACTIVITE_ID

    I want to add the column to the DURATION of the two tables when they get the same FICHE_ID. FICHE_ID is not a join field.

    I've tried this application, but it gives result when two recordings of the two table share the same number FICHE_ID.

    SELECT AF. FICHE_ID, SUM (NVL (AF. LENGTH, 0)) + SUM (NVL (AEF. LENGTH, 0))

    OF AF, ACTIVITE_EXCEP_FAITE AEF ACTIVITE_FAITE

    WHERE AF. FICHE_ID = AEF. FICHE_ID

    GROUP BY AF. FICHE_ID;

    Can you help me write this selection?

    Thank you very much for your help!

    Like this?

    select nvl(af.fiche_id, aef.fiche_id) fiche_id
         , sum(nvl(af.duree,0)) + sum(nvl(aef.duree,0)) duree
      from activite_faite af
      full join
           activite_excep_faite aef
        on af.fiche_id = aef.fiche_id
     group by nvl(af.fiche_id, aef.fiche_id);
    
  • Weighted average end days: how the sum in different currencies?

    Hello

    I have to introduce a new column named "averages weighted days late" in one of the models.

    It was easily handled by the code in the Oracle report: Aging Ar: calculated as <? If: SUM_PAYMENT < = 0? > 0 <? end if? > <? If: SUM_PAYMENT > 0? > <? SUM_W_DAYS_LATE div SUM_PAYMENT? > <? end if? > UX f

    The customer wants that this weighted means against the different currencies for a single client: How do I implement that?

    Example: Client A - average weighted days late:-16-20 in USD and EUR. = > report displays only the first currency - in this case EUR = >-16 (which is not what is expected)

    Logic: I need to run (-16) +(-20)/2. The logic is simple. However, where should I create this change? Also, this change must be connected to the period during which the report is run for / just for the money? I guess it's related at the same time.

    Thanks in advance

    and then divide it by the number of transactions.

    That's your logic? If yes then ok

    I don't know full logic

    And this must be done in the sql used in the xml file, I guess. Is there an easier option to calculate the end of days average weighted by a modification of the model code? Curious.

    If you already have some fares in the xml file to recalculate, then you can do so by model

    If you do not have the rate, then you can add it to xml format and then calculate by model

    or you can calculate in sql (as an example of data model) and then only show models

    How will be used it is your decision

  • How many gigabytes of data storage has the new Apple Watch series 2 and how many GB are free for music?

    How many gigabytes of data storage has the new Apple Watch series 2 and how many GB are free for music?

    Hello

    Apple has not yet announced the capacity of storage or the music of Apple Watch series 2 storage limit.

  • How to take the sum of a cluster

    Hey Im trying to convert a matlab code in labview and I came across this issue with clusters. can anyone help?

    Let's say that:

    [Pxx, w] is periodogram (mydata, [], [], var]

    Time = Sum(mydata.^2) /length (mydata)

    FREQ = Sum (Pxx)

    Pxx = Pxx * time/frequency

    Pxx = sqrt (Pxx)

    LogLog (w, Pxx)

    I managed to make the PSD of mydata and translate code time labview...

    But how to make the sum of the Pxx which is clearly going to be a cluster of 3 elements (magnitude, df, f0)... Help?

    My point exactly! I therefore decided to unbundle the Psd with the sum of the elements of the array size. He then rebundle with f. and don't know if it will work DT...

  • How to generate the clock 8,192 MHz on the labview FPGA 7854R series card?

    Hello

    I use the NI PXI-7854R series card that has 5 FPGA from Xilinx Vertex on him. I'm drifting clockwork 8,192 MHz to 40 MHz on board the FPGA clock. But he ended up giving me a single clock 8 MHz. is it possible to access the PLL located on FPGA Xilinx?

    Concerning

    If you are familiar with VHDL you can make your own "component-level IP' (aka CLIP) with a PLL Xilinx inside.  There are topics for help and examples of how to define a CLIP.  Here's one that shows how instantiate a DCM (similar to a PLL) in a CLIP:

    http://zone.NI.com/reference/en-XX/help/371599F-01/lvfpgahelp/fpga_clip_clock_ex_code/

  • How can I add the same properties to the __names of a series of files

    I would like to add a few properties on the front of several files. instaead clicking Rename and add them one by one, how can I add the same properties in the names of a series of files

    Hello Ronke2009,

    Welcome to the Microsoft Answers Community!

    Using the function rename in Windows results in action that you said earlier, with all records even renamed with a number appended to the end. You can get the service you are looking for with a third party tool. A good search Bing.com for these would be something like Bulk Rename Utility or editor to rename block.

    Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    Hope that helps, I look forward to hearing from you.

    Steven
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • I would like to know how to put music to the image or a series of photos. How can I put music to my background image?

    How to set my background music?  How can I set the music in a series of photos?

    I suggest you use Windows Movie Maker... You can put all the photos one after the other and give and music, effects and animation... MOEEN AJAZ KHAN MD - MCP/N + / A +.

  • How cab I find the serial number for the Photosmart HP 4580 series or model. Many unidentified figures.

    All of a sudden my printer (HP Photosmart 4580 series) stopped working with an incompatible cartridge error message. Foolishly, I took a cartridge and managed to damage it. Since I found a page on the fair questions that could help. However when I tried to find the model and serial numbers and the printer, none seems to be identified or resemble those on video from HP.

    Some of the number there are on the machine are:

    [serial number removed]

    Q8400-64001 (32)

    1H7EHHCE9

    SNPRB-O721-02

    CCAF08LP0120T4

    The number on the cartridge rises to 350.

    Can anyone help, even with an example of how the number should look like even if it is not the same?

    That is great news! Can you please mark my recommendation (post # 2 in this thread) as the accepted solution? This will help other members of the community looking to find series/number produces an easy solution!

    Thank you in advance!

  • I have the table of 3 columns A, B, C. I want to store the sum of columns A B in the C column without using the DML statements. Can anyone help please how to do. ?

    I have the table of 3 columns A, B, C. I want to store the sum of columns A B in the C column without using the DML statements. Can anyone help please how to do. ?

    11.1 and especially you have virtual column

    SQL> create table t
      2  (
      3     a number
      4   , b number
      5   , c generated always as (a+b) virtual
      6  );
    
    Table created.
    
    SQL> insert into t (a, b) values (1, 2);
    
    1 row created.
    
    SQL> select * from t;
    
             A          B          C
    ---------- ---------- ----------
             1          2          3
    

    Before that, a front insert - trigger

    SQL> create table t
      2  (
      3     a number
      4   , b number
      5   , c number
      6  );
    
    Table created.
    
    SQL> create or replace trigger t_default before insert on t for each row
      2  begin
      3    :new.c := :new.a+:new.b;
      4  end;
      5  /
    
    Trigger created.
    
    SQL> insert into t (a, b) values (1, 2);
    
    1 row created.
    
    SQL> select * from t;
    
             A          B          C
    ---------- ---------- ----------
             1          2          3
    
  • How to calculate the sum of the fields to fill?

    Hello!

    My question is how can I calculate the sum of filled areas?

    For example, in a PDF document, I have a few fields that must be filled out with name and surname and the end of the document, another field that is the sum of the fields "FullName" which shows how many people is in this document. The operation should not take into account white/empty areas.

    Now, I know that I could do with the simple calculation "(+) sum" but I have to put a '1' for each of this area and I would like to avoid this.

    Yes, it's the first option I described. In this case, you can use this code:

    var total = 0;
    for (var i=1; i<=79; i++) {
        if (this.getField("Nume si prenume "+i).valueAsString!="") total++;
    }
    event.value = total;
    

Maybe you are looking for

  • HP Pavilion p7-1534 Desktop Gaming PC upgrades.

    Hello, my current setup is a desktop PC HP Pavilion p7-1534 with all stock parts. And I want to upgrade my computer to play recent games like dogs Watch decent settings. I'm looking to upgrade everything that could make better games and faster. From

  • How to check my identity?

    Hi, I go the settings-> iCloud-> password and security. I want to change my Security Questions, because I have lost the answers, I would also like to set up an alternate email address. I can't do these things because when I type the Questions of safe

  • Microsoft for the 2004 Apple .xls files convert to numbers

    How to import the file an.xls (Microsoft for Mac 2004) in numbers? I would like to know before you download the latest numbers/Pages of Apple applications. I put El Capitan on my iMac 2009 and lost Microsoft Office 2004 with the upgrade to the new sy

  • (Redirected) Short screen freezes on XPS12

    I need help. I've looked everywhere and tried several things but my screen freezes for a short period (5 to 10 seconds in general) every few minutes. I have: -updated my touchpad of Cypress software at latest as Dell (2.5.1.72) -reinstalled my mouse

  • SanDisk Sansa e260 4GB Media Player

    How can I reverse sync files voice of my Sansa e260 in my computer, i.e. upload voice files from the Mp3 player to the computer? Thank you Mel