Sum of the values in a table

Please forgive me...  I'm a total newbie to livecycle.  I have a dynamic table where the user starts out with a single line for more information, but it can add lines as needed (add the instance) to list more buildings.  Among other things, they must indicate the location of the building (from a drop in the drop - ie. it has a binding for each location) and an amount representing the insurable value of the building.

Amount of the
Location
LC1$100,000
LC1$125 000
LC1$100,000
LC2$150,000
LC2$130 000
OCP$200,000
OCP$175 000
OCP$100,000

In a totally different subform, I can generate the total good enough general using formcalc: sum (Buildings.Row4 [*]. Amount [*])

But how would generate a sum for each location?  In other words, use the location as a criterion for the amounts that make amalgam.

You can use a loop for to do this.

This example adds all the locations named LC3.

var s = 0

for i = 0 upto Buildings._Row.count-1

If (Buildings.Row [i]. Location eq "LC3") then

s = sum (s, Buildings.Row [i]. Amount)

endif

ENDFOR

$ = s

Tags: Adobe LiveCycle

Similar Questions

  • SQL query to display the sum of the values of each June and December

    Hello having problems of construction of a query to the list SQL query to display the sum of the values of each June and December each year.

    My Table;

    TABLE name: MONTH_TERM

    Fields with values:

    TERM_KEYMONTH_ACTUALMONTH_DATE
    8250001/11/2015 0:00
    8245001/12/2015 0:00
    8240501/01/2016 0:00
    8240001/02/2016 0:00
    8245001/03/2016 0:00
    8242501/04/2016 0:00
    8243501/05/2016 0:00
    8241006/01/2016 0:00
    8240901/07/2016 0:00
    8241501/08/2016 0:00
    8242009/01/2016 0:00
    8242210/01/2016 0:00
    8243611/01/2016 0:00
    8255601/12/2016 0:00
    8256801/01/2017 0:00
    8262402/01/2017 0:00

    What I would like to see in a query result:

    TERM_KEYMONTH_ACTUALMONTH_DATETotal of 6 months
    8250001/11/2015 0:00
    8245001/12/2015 0:00950
    8240501/01/2016 0:00
    8240001/02/2016 0:00
    8245001/03/2016 0:00
    8242501/04/2016 0:00
    8243501/05/2016 0:00
    8241006/01/2016 0:002525
    8240901/07/2016 0:00
    8241501/08/2016 0:00
    8242009/01/2016 0:00
    8242210/01/2016 0:00
    8243611/01/2016 0:00
    8255601/12/2016 0:002658
    8256801/01/2017 0:00
    8262402/01/2017 0:00

    ---

    Here's my query:

    Select

    "TERM_KEY,"

    "MONTH_ACTUAL,"

    to_char(MONTH_DATE,'MM/YYYY') MONTH_DATE,

    DEAL to_char (MONTH_DATE, 'MM')

    WHEN '06' THEN (SELECT SUM (MONTH_ACTUAL)

    OF MONTH_TERM

    WHERE the to_char (MONTH_DATE, 'MM') between 1 and 6

    AND term_key = 82)

    WHEN '12' THEN (SELECT SUM (MONTH_ACTUAL)

    OF MONTH_TERM

    WHERE the to_char (MONTH_DATE, 'MM') between 7 and 12

    AND term_key = 82)

    ELSE null

    END as SIX_MO_CUMM,

    of MONTH_TERM

    where term_key = 82

    It's my results:

    TERM_KEYMONTH_ACTUALMONTH_DATETotal of 6 months
    8250001/11/15 0:00
    8245001/12/15 0:003608
    8240501/01/16 0:00
    8240001/02/16 0:00
    8245001/03/16 0:00
    8242501/04/16 0:00
    8243501/05/16 0:00
    8241001/06/16 0:003717
    8240901/07/16 0:00
    8241501/08/16 0:00
    8242001/09/16 0:00
    8242210/01/16 0:00
    8243601/11/16 0:00
    8255601/12/16 0:003608
    8256801/01/17 0:00
    8262401/02/17 0:00

    Any ideas on how to fix would be great

    Select term_key,

    month_actual,

    month_date,

    case mod (to_char (month_date, 'mm'), 6)

    When 0 then sum (month_actual)

    During)

    term_key partition

    order of month_date

    between the previous month '5' interval and the current line

    )

    end '6 MONTHS in TOTAL'

    from tbl

    order of term_key,

    month_date

    /

    TERM_KEY MONTH_ACTUAL MONTH_DAT 6 MONTHS TOTAL
    ---------- ------------ --------- --------------
    82 500 NOVEMBER 1ST, 15TH
    82 450 1 DECEMBER 15 950
    82 405 1 JANUARY 16
    82 400 1 FEBRUARY 16
    82 450 1ST MARCH 16
    82 425 1ST APRIL 16
    82 435 1 MAY 16
    82 410 2525 1 JUNE 16
    82 409 1 JULY 16
    82 415 1ST AUGUST 16
    82 420 16 - SEP - 01

    TERM_KEY MONTH_ACTUAL MONTH_DAT 6 MONTHS TOTAL
    ---------- ------------ --------- --------------
    82 422 1 OCTOBER 16
    82-436 NOVEMBER 1, 16
    82 556 2658 1 DECEMBER 16
    82 568 1 JANUARY 17
    82 624 1 FEBRUARY 17

    16 selected lines.

    SQL >

    SY.

  • dynamic sum of the values entered into the Web page

    Hello

    I have a question I want to display the total sum of the values entered in the web page

    Suppose I have 3 fields

    If I enter 10 in the first field, it should consider other value two field 0

    and it prints the 10 in total value.

    next register 15 in the second field, then he cosiders 3rd classified is 0 and altogether it prints 25

    like that, I want to display the total values whenever the user enters the value in the textfield

    Hi all

    I found the solution to this blog

    Blog of Anil Oracle Application Framework: Dynamics for summation in advanced table

  • sum of the values in a row

    Hello

    I have a table table1 with the columns a, b, c and d

    I get some results this table using this query:

    SELECT
    a,
    b,
    sum (case when c = 'F' then '1' other '0' end) 'c_data. "
    sum (case when d = s 'then ' 1' other end '0') "d_data".
    Of
    Table1:
    WHERE
    a = 'a value '.
    GROUP BY
    b

    My result will be like this:
    a d_data of c_data to b
    ABCD efg 1 1
    Fund fjd 1 0
    DFD fd 0 0

    Now I need a 5th column, which should look like this: -.
    a b c_data d_data Total
    ABCD efg 1 1 2
    Fund 1 0 1 fjd
    DFD fd 0 0 0

    Please someone change and give me the above query?

    Double wire.
    sum of the values in a row

    Please close.

  • Setting the value of a table of ActiveX control

    When controling a VI through ActiveX, how is possible to set the value of a table control?

    With digital controls, I have a problem: I just use SetControlValue and it works well:

    til SetControlValue ('y', 4) for example.

    However, in trying to do the same thing with a table, the control's value becomes an empty array:

    til SetControlValue ("arr', [3-4-5]") for example.

    What is the right way to do it?

    Hi Calvin,

    Have you tried passing a string and convert it to an array entry?  You can also try to use a 'matrix' control, rather than a table, as they are handled a little differently.

  • Alternative to obtaining the value of a table

    Nice day!

    I am new to the forum and Oracle (<-SQL Server Dev), I would like to know if there is an alternative to get the values in a table. I would like to avoid catching an exception if there is no data found especially and always continues with it.

    declare
    number of v_number;
    Start
    Select code in v_number from someTable where id = 1;

    -I still want to continue despite no data
    If v_number is null then
    -do something
    v_number: = 1; -1 initialization

    end if;

    -Continue normal processing.
    -other codes

    end;

    Thank you

    Welcome to the forum.

    Read about the MANAGEMENT of EXCEPTIONS like NO_DATA_FOUND.
    See: {message identifier: = 9360013}

    And of course the docs @ http://www.oracle.com/pls/db112/homepage
    http://www.Oracle.com/pls/db112/search?remark=quick_search&Word=exception+handling

  • How to load the values into a table?

    In my jspx page, I have a combo and a table... Based on the values of the drop-down list, when I click on a button, I want to load the values into a table... The data in the table are from 5 database tables. I created a viewObject readonly... What to do to load the values from the table, I click on a button?

    Ensure that you have defined a variable to bind your view object.

    Read-only or not, this is what would make the Execute with action of parameters available.

    John

  • How to calculate the sum of the values of some columns in a table

    Hello

    I want to get the column just the average of the values of some columns not all columns of the table.what I have to change exactly in this block diagram.even if the table size is 25 average, I want the division as the number of values in each column (= number of lines)

    just like that:


  • Returns the sum of the values of certain months

    Hello

    I have a table that I keep a record of my overtime. See below.

    I want to do another table of the month (Jan, Feb, Mar etc.) and next to it the sum of all overtime worked each month.

    My salary is developed from the 4th of each month to the 4th on the other, I am able to add up the values of the different months and specify between the 4th one on the 4th of another?

    Thanks in advance.

    One way to do would be to use SUMIFS.

    The formula in B2, filled to the bottom:

    = SUMIFS(Table 1::$E,Table 1::$A,">"&C2,Table 1::$A,"<"&D2)

    The formula in C2, filled to the bottom:

    = A2 + 4

    The formula in D2, filled to the bottom:

    = EOMONTH(A2,0) + 5

    Column A contains strings of date and time in the format to display the month only.

    SG

  • Through the sum of the values in all of the array of Boolean one and zeros

    Hello.

    I have an array of Boolean which I have converted one and zeros. I just want to the sum of all the elements in this table (in other words, giving the number of 1 in the table). I used the feature to add items, but I get a negative value. I checked there were not all values except one and zero (I know it shouldn't be) using max and min. I don't know how a negative value has been calculated - any ideas.

    Thanks in advance

    Before adding elements, convert the table I32 or I64. The output of the primitive add-on is of the same type that the entry and if the entry is an I16, then you cannot have a value greater than 32,767 or value will wrap around (what happened in your case.

  • update of column based on the sum of the data from another table

    I have two tables:

    Table1 (col1, col2, col3, col4, val1, status) Table2 (col1, col2, col3, col4, val2)

    For Table1 and Table2, column (col1, col2, col3, col4) are the primary key of composit.

    Table2 could have duplicated lines, that's why I want to group by (col1, col2, col3, col4) and sum (val2)

    After that, I want to update Table1.val1 with the value of sum (Table1.val2) where Table1.col1 = Table2.col1 and Table1.col2 = Table2.col2 and Table1.col3 = Table2.col3 and Table1.col4 = Table2.col4 and status = 'V '.

    I did something like this:

    UPDATE Table1 SET val1 = (

       

    WHERE Table1.col1 = t_sommevbrute.col1 and Table1.col2 = t_sommevbrute.col2 and Table1.col3 = t_sommevbrute.col3 and Table1.col4 = t_sommevbrute.col4)

    Could someone help me please? Thank you

    merge into table1 t1

    using (select col1, col2, col3, col4, sum (val2) val2

    from table2

    Group

    by col1, col2, col3, col4) t2

    on (t1.col1 = t2.col1 t1.col2 = t2.col2 and t1.col3 = t2.col3 and t1.col4 = t2.col4 and)

    When matched then

    update set t1.val1 = t2.val2;

  • Sum of the values of the previous rows in a PivotTable

    Hello

    I have a dynamic table has several lines (dynamically added via a button).  A column in the table is a quantity column.  Another is a Total of the column.  We do not keep a cumulative, but wants to only display an total when the rest of the cells in the same row are emty and the previous lines has / have values in the quantity column.  The Total is the sum on the Quatnities until a blank line.  Here is a sample.  How can I get the value of the quantities in the previous lines?

    Quantity Total


    5
    8
    12

    25


    7
    27

    34


    22

    22


    Another option could be to put the Total in the last row with data as opposed to the line below the data.

    Any ideas?

    Kind regards

    Karl

    The script is written to achieve your requirement (i.e. the second approach you mentioned)

    .

    You can either contact me at [email protected] for the example of created form.

    Or what follows is the Source XML of the form. Copy all the content in your form XML source mode and see the result.

    http://ns.Adobe.com/XDP/"timeStamp =" "2012-02 - 28 T 14: 04:54Z ' uuid ="2c561cdf-3377-4e84-9a89-51e740bb2fea">"

    Adding line

    Quantity

    Total

    user interface

    >

    character = "Myriad Pro

    "/>

    margin = topInset ' 1 mm ' bottomInset = ' 1 mm ' leftInset = ' 1 mm ' rightInset = ' 1 mm»

    "/>

    para vAlign = "middle".

    "/>

    border

    >

    edge

    />

    angle thickness = "0,1778 mm

    "/>

    border

    >

    field

    >

    = "Total" field name "44.47 mm" h = w = "9,317 mm" access = "readOnly".

    ">

    user interface

    >

    numericEdit

    >

    presence at the border = "hidden".

    ">

    border

    >

    the margin of

    />

    numericEdit

    >

    user interface

    >

    character = "Myriad Pro

    "/>

    margin = topInset ' 1 mm ' bottomInset = ' 1 mm ' leftInset = ' 1 mm ' rightInset = ' 1 mm»

    "/>

    this.rawValue = null; Clear the total value

    }

    } catch (e)

    {

    app.alert (e)

    }

    9.0.0.0.20091029.1.612548.606130

    http://www.XFA.org/schema/XCI/2.8/">

    PDF

    1.7

    3

    *

    http://www.XFA.org/schema/XFA-locale-set/2.7/">

    January

    February

    March

    April

    May

    June

    July

    August

    September

    October

    November

    December

    Jan

    Feb

    Mar

    Apr

    May

    Jun

    Jul

    Aug

    Ms

    Oct

    Nov

    Dec

    Sunday

    Monday

    Tuesday

    Wednesday

    Thursday

    Friday

    Saturday

    Sun

    LUN

    Mar

    Fri

    Game

    Fri

    Sam

    AM

    PM

    BRITISH COLUMBIA

    AD

    EEEE, MMMM D, YYYY

    MMMM D, YYYY

    MMM D, YYYY

    M/D/YY

    SS Z

    SS Z

    SS HAS

    h: mm A

    GyMdkHmsSEDFwWahKzZ

    z, zz9.zzz

    $z, zz9.99 | ($z, zz9.99)

    z, zz9%

    .

    ,

    %

    -

    0

    $

    USD

    .

    "RDF: RDF xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#

    ">

    "RDF: description xmlns:xmp ="http://ns.adobe.com/xap/1.0/"rdf: subject"

    ="">

    XMP:MetadataDate > 2012-02-28 T 14: 04:54Z

    >

    XMP:CreatorTool > Adobe LiveCycle Designer ARE 9.0

    >

    RDF: description

    >

    "RDF: description = xmlns:pdf"http://ns.adobe.com/pdf/1.3/"rdf: subject"

    ="">

    PDF:producer > Adobe LiveCycle Designer ARE 9.0

    >

    RDF: description

    >

    "RDF: description = xmlns:xmpMM"http://ns.adobe.com/xap/1.0/mm/"rdf: subject"

    ="">

    xmpMM:DocumentID > uuid:2c561cdf-3377-4e84-9a89-51e740bb2fea

    >

    RDF: description

    >

    "RDF: description = xmlns:desc"http://ns.adobe.com/xfa/promoted-desc/"rdf: subject"

    ="">

    DESC:version rdf:parseType = "resource".

    ">

    RDF: value > 9.0.0.0.20091029.1.612548.606130

    >

    DESC:REF > / template/subform [1]

    >

    DESC:version

    >

    RDF: description

    >

    RDF: RDF

    >

    x: xmpmeta >

  • trigger for update field in a table with the sum of the fields to another table

    My experience in creation of triggers and pl/sql in general can be described in terms of oracle with the null value. I practiced by creating arrays and applications on my personal server at home to help me with some of my work related tasks. Right now I am creating a trigger which will, after insert, update, delete on the update of the table assignment_time_track the area of the time_spent on the table of assignments with the sum of the time_spent on the assignment_time_track table fields. I hope that run on the sentence it is clear to the people other than me. I tried this script on my own using the tool of creation of trigger for Oracle Database Express Edition, but I get the following error:

    Create a trigger failed, for the following reason:
    ORA-06552: PL/SQL: ORA-06553 finished Compilation unit analysis: PLS-320: the declaration of the type of the expression is incomplete or incorrect

    Here is my attempt to create the trigger on my own.

    create or replace trigger "ASSIGNMENT_TIME_TRACK_T1".
    AFTER
    INSERT or update or delete on 'ASSIGNMENT_TIME_TRACK '.
    for each line
    Start
    update assignments
    Set time_spent = (select sum (time_spent)
    of assignment_time_track
    where assignment_time_track.name = assignments.name);

    end;
    /


    If what I posted is not clear or more detail is needed, let me know and I will respond with a full description of tables and my goals for each table. Thanks in advance for any help. I also gladly accepts links to tutorials or lessons that explain how to do this kind of thing.

    Published by: bobonthenet on March 9, 2009 14:01

    I think I understand what you mean :)

    Rather than use a trigger to keep the master table (assignments) in sync with the time spent on the details, it would be much easier to use a query to do this, maybe creating a view.

    Something along the lines of

    SQL> create table assignments
      2  (id number primary key
      3  ,name varchar2(10)
      4  );
    
    Table created.
    
    SQL>
    SQL> create table assignment_time_tbl
      2  (id number primary key
      3  ,assid number references assignments
      4  ,time_spent number
      5  );
    
    Table created.
    
    SQL>
    SQL> insert into assignments
      2  select rownum
      3       , 'a'
      4    from all_objects
      5   where rownum < 5
      6  /
    
    4 rows created.
    
    SQL>
    SQL> insert into assignment_time_tbl
      2  select rownum
      3       , rownum
      4       , rownum * 3
      5    from all_objects
      6   where rownum < 5
      7  /
    
    4 rows created.
    
    SQL>
    SQL> commit;
    
    Commit complete.
    
    SQL>
    SQL>
    SQL> select a.id
      2       , a.name
      3       , (select sum (time_spent)
      4            from assignment_time_tbl
      5           where assid = a.id
      6         )
      7    from assignments a
      8  /
    
            ID NAME       (SELECTSUM(TIME_SPENT)FROMASSIGNMENT_TIME_TBLWHEREASSID=A.ID)
    ---------- ---------- -------------------------------------------------------------
             1 a                                                                      3
             2 a                                                                      6
             3 a                                                                      9
             4 a                                                                     12
    
  • Going crazy on the values of stale table f *.

    Some seriouse need help now.

    My goal is to build a table whenever a real touch.

    1. create a table based on the values programitlitly beeing past in the table

    2. This should each time when a Boolean value is true.

    3. the table building function should wait 6 s before storing in the table when the value is true

    My problem is that when I press True, and I start changing the starting value (say 0) desired value I want that it either (say 5) before six seconds pass, the value passed to the table after 6 seconds is the starting value of 0 not the value of dessired 5. This value appears the next time that I push the real button.

    It drives me crazy

    And the desired value must come within a structure of sequence because of the structure of the main VI (this is just an excerpt of this cose)

    HELP Please!

    Probably, this should solve your problem.

  • Assistance needed for the registration of the application and store the values in a table

    Hello

    Hope that this explanation is not confusing. I explained my application you want in the text below and also attached a skeleton VI + screenshot hoping that he will clarify

    I try to do a VI that does the following:
    1. some code (blue Subvi) runs every 200ms
    2. every 200ms, a random number is generated
    3. the random numbers are stored in a table in intervals of time s 0.8 ("iterations")
    4. at any time, the (blue Subvi) code needs to have access to the random numbers generated in 'the previous iteration.

    To clarify, the iterations are as follows:
    Iteration #1: 0 - 1.8 s
    Iteration #2: 2 - 2. 8 s
    Iteration #3: 3 - 3.8 s

    Iteration #4: 4 - 4.8 s
    ..
    And so on...

    So for each iteration: the blue (Subvi) needs to have access to the random numbers generated in the previous iteration, for example:

    Iteration #1 (0 - 1.8 s): The blue (Subvi) Gets an array that contains only the zero (random numbers are recorded for the first time)
    Iteration #2 (2s - 2 8 s): The code gets an array containing random numbers of iteration #1
    Iteration #3 (3 s - s 3.8): the code gets an array containing random numbers of iteration #2
    Iteration #4 (3 s - s 3.8): the code gets an array containing random numbers of iteration #3
    ..
    And so on...

    At any given time in time;
    -The code gets an array that contains all the random, recorded during the previous iteration numbers
    -Values since before her previous iteration are ignored and not stored anywhere

    Thus, for example, to the #7 iteration:

    -The values during the iteration #6 are made available to the code in the form of a table

    -Values of #1 to #5 iterations have been deleted and not stored anywhere

    It is important that all values since before recording the previous iteration are deleted because they are not necessary because VI actaual will work for a long period of storage of numbers a lot more than I have indicated here

    Screenshot of the skeleton VI:

    I tried to play with the paintings, the structures of the case and the registers at offset, but everytime I try I get something wrong

    The skeleton VI is also attached (Iteration_VI and Code_SubVI)

    Any suggestions?

    Thank you!

    Yes, I agree that you need help.  First of all, you really do need to learn more about LabVIEW - spend a few hours with the tutorials, such as those mentioned on the first page of the Forums.  Oops - links to the tutorials which had been present for years seem to have been moved "elsewhere" with August 2016 LabVIEW community reorganization.  But look for them...

    Here are a few screws that basically implement what I described above (with some minor modifications).  First of all, this is a Top level VI which runs at 5 Hz (200 msec waits).  It starts with an array of 5 elements of 0, then once per second, this is replaced by a table of random numbers generated by the Random 5-table sub - VI 5 elements.  Note that I do not use a loop timed - those who are really designed for LabVIEW RT, but use the simplest functions on the Palette of the timer.

    Can't you see how that works?  The array to initialize on the left begins you with a table of 5 elements of 0.  The Timer inside the loop, it runs at 5 Hz, 'Index' counts 1, 2, 3,... to tell you where you are, and 5 shows you everything that lives on the shift register.

    Now sub - VI Random 5-table is supposed to do the following - if she was called to 5, 10, 15,..., it must return a (new) array of 5 random numbers, otherwise, it must return the array that was passed in.  So if all "works", table 5 shows 0, 0, 0, 0, 0 for the first second, a table at random for the second second (which is not superfluous!), a different for the third random picture second and so on.  I have already said a way to build this, but I chose a slightly different method (equivalent).

    Whenever it is called, a new random element is generated and added at the end of a (growing) random table stored in the shift register.  If size become 5, we send this Random-table-of-5 out through Out table and reset the register shift to an empty array.

    The case by default (when the size is not equal to 5) is shown below - we just return the array of entry to and accumulate new random table in full growth.

    These code fragments extracted from VI.  If you have LabVIEW 2016 (see the "2016" at the top right of the image?  This shows that it is a snippet of code LabVIEW 2016), you can open a blank diagram and drag this image, where magic OR converts it to a VI.  Otherwise, the code yourself and try out it.

    Caution - it is designed to run once.  If you run the program of high level, a second time, you may find that the new Random 5 - table appears to 0.4 ", 1.4", 2.4"(instead of 1", 2 ", 3").  I leave as an exercise for understand you to (a) why he is and (b) fix the code.  If you can't do that, then move an another 3-4 hours with the LabVIEW tutorials (or start playing with this code, edit it in some small way and to understand how it works).

    Bob Schor

Maybe you are looking for