CALCULATE the sum of the amounts?

Hey guys!

This script:
CLEAR      COMPUTES 
CLEAR     BREAKS

SET     feedback     off
SET     pagesize     5000
SET     linesize     50
SET     echo          off
SET     heading          on
SET     verify          off

COLUMN     User format     A8
COLUMN     Files format     999999999
COLUMN     Docs format     999999999
COLUMN     Pages format     999999999

COMPUTE SUM LABEL TOTAL OF "FILES", "DOCS", "PAGES"

PROMPT     ************************************************** 
PROMPT     *         Monthly File Activity by User          *
PROMPT     ************************************************** 
PROMPT      
PROMPT      
ACCEPT     StartDate     DATE FORMAT 'MMYYYY'      PROMPT 'Enter the month and year (MMYYYY): '
PROMPT     
PROMPT      List of users:
PROMPT      One
PROMPT      Two
PROMPT      Three
PROMPT      Four
PROMPT      Five
PROMPT      Six
PROMPT      Seven
PROMPT     UNKNOWN
PROMPT       
PROMPT     Type 'ALL', or leave blank, to select all users.
PROMPT      
ACCEPT     UserChoice     DEFAULT 'ALL'     PROMPT 'Please enter a user: '


SELECT
     (CREATOR_ID
                   WHEN     '1'     THEN     'One'
                 WHEN     '2'     THEN     'Two'
          WHEN     '3'     THEN     'Three'
          WHEN     '4'     THEN     'Four'
          WHEN     '5'     THEN     'Five'
          WHEN     '6'     THEN     'Six'
          WHEN     '7'     THEN     'Seven'
          ELSE     'UNKNOWN'
          END)     "USER",
     count       (distinct(substr(DOC_NAME,1,9))) AS Files,
     count     (DOC_IMAGE) AS Docs,
     sum     (DOC_PAGE) AS Pages
FROM
     TABLE1,
     TABLE2
WHERE
     DOC_DATE to_date('&StartDate','MMYYYY') AND last_day(to_date('&StartDate','MMYYYY'))
AND
     CREATOR_ID not in ('Thing','8','9')
AND
     ((CREATOR_ID
                   WHEN     '1'     THEN     'One'
                 WHEN     '2'     THEN     'Two'
          WHEN     '3'     THEN     'Three'
          WHEN     '4'     THEN     'Four'
          WHEN     '5'     THEN     'Five'
          WHEN     '6'     THEN     'Six'
          WHEN     '7'     THEN     'Seven'
          ELSE     'UNKNOWN'
          END) = UPPER('&UserChoice')
     OR
     '&UserChoice' = 'ALL')
GROUP BY
     CREATOR_ID
/
produces this result:
USER          FILES       DOCS      PAGES
-------- ---------- ---------- ----------
One             261       4276      18124
Two             364       5954      26913
Three           109       1996       8243
Four            178       3635      14554
Five            104       2657      11662
Six             308       6639      27887
I would like for a labeled sum TOTAL at the bottom of these figures. I thought that COMPUTE would take care of this, but it's not. Am I missing something? It will not add these to the top because they are already money from specific users? Insight? I'm new to SQL and would like to be pointed in the right direction. Thanks for your expertise!

I'm on a 10g system.

Calculation is not SQL and SQL * more.
The general syntax is
calculate the sum of... the * | * report

followed by
break the report
When this is necessary.

-----------
Sybrand Bakker
Senior Oracle DBA

Tags: Database

Similar Questions

  • Calculate the amount in an entity does not contribute to the parent


    Hello

    I'll try to explain my problem.

    I need to put in a base entity (E01) the opposite of the value stored in another entity (E02) for the same account (A01) and PKI (PKI no), but for a different value of custom3;
    the expresison used is the following:

    Void calculate)

    ...

    If HS. Entity.Member = E01 then

    HS. Exp ' an A01 #.» I have #[ICP no]. C3 C3 #02 HS =. GetCell ("a #A01.") I have #[ICP no]. E #E02. C3 C3 #01") *-1.

    end if

    ...

    End Sub

    The rule works for E01 entity, but the problem is that when the consolidation runs, the amount so calculated in E01 the sum is not in the parent company of E01.

    Thanks in advance

    Andrea

    Hello Andrea,

    You may need to replace:

    If HS. Entity.Member = E01 then

    with

    If HS. Entity.Member = E01 and HS. Value.Member = "" then

    Kind regards

    Thanos

  • To calculate the amount on the basis of the date of

    Hello

    We must consider the functionality of oracle when it sees in 365 days a year. (for leap years 366 days)

    calendar year of 365 days. calendar year of 12 months. Months will track the number of calendar days in the month. For example the Feb has 28 days and Oct. has 31 days.

    Example:

    For the period from 27/06/12 to 20/08/12

    Annual amount of $3214.

    Calculation

    $3214 / 12 months = $267,83 per month

    For June, $267,83 / 30 days in a month = $8.93 daily rate

    6/27-6/30 is 4 days of service.  x 4 = $35,72 $8.93

    7/1-7/31 is considered to be a full month. = $267,83

    For August, 8/1 /-8/20 is considered to be 20 days. Per day = 267.83 / 31 = 8.64

    20 days = $172.79

    TOTAL = $476,34

    Please help me on how to do the following calculations.

    Concerning

    Suresh

    Another solution, works better than the previous:

    with the data as

    (

    Select to_date (June 27, 2013 ',' DD/MM/YYYY ') from_dt, to_date (August 20, 2013 ',' DD/MM/YYYY ') to_dt, amt double 3214

    )

    Select sum (DM)

    de)

    Select from_dt, to_dt, start_dt, last_dt,

    (last_dt - start_dt + 1) *--> multiply applicable days of the month at the daily amount, calculated below

    Sum)

    round)

    (amt/12) /--> calculate a monthly amount

    TO_CHAR)

    LAST_DAY (curr_dt)

    , 'DD '.

    )--> Find last day of the month and divide the monthly amount with the last day and calculate the daily amount

    2

    )--> Around the daily amount to 2 decimal places

    ) on sm--> sum the amount daily (partition to_char (curr_dt, 'MM'))

    de)

    Select from_dt, to_dt, TN,

    less (add_months (from_dt, level - 1), to_dt) curr_dt,.

    decode (level 1, less (add_months (from_dt, level - 1), to_dt), trunc (less (add_months (from_dt, level - 1), to_dt), 'MM')) start_dt;

    less (last_day (add_months (from_Dt, level - 1)), to_dt) last_dt

    from the data

    connect by level<= months_between(trunc(to_dt,="" 'mm'),="" trunc(from_dt,="" 'mm'))="" +="">

    )

    );

    SUM (DM)

    ----------------------

    476.36

    This avoids looping of data for all of the Dates if opposed to a loop for each month, which increases its performance. See plans to explain to the two queries:

    explain plan for

    with the data as

    (

    Select to_date (June 27, 2013 ',' DD/MM/YYYY ') from_dt, to_date (August 20, 2013 ',' DD/MM/YYYY ') to_dt, amt double 3214

    ),

    div_data as

    (

    Select from_dt, to_dt, annual_amount from the amt Tower (amt/12, 2) monthly_amount

    from the data

    )

    Select sum (per_day_amt)

    de)

    Select to_char (level - 1, 'Lun' + from_dt) curr_dt,.

    sum (round (monthly_amount/to_number (substr (to_char (last_day (level - 1 + from_dt), 'DDMMYYYY'), 1, 2)), 2)) per_day_amt

    of div_data

    connect by level<= (to_dt="" -="" from_dt)="" +="">

    To_char Group (level - 1, 'Lun' + from_dt)

    );

    Hash value of plan: 1042012692

    ----------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                        | Lines | Bytes | Cost (% CPU). Time |

    ----------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                             |     1.    13.     5 (20) | 00:00:01 |

    |   1.  TRANSFORMATION OF THE TEMPORARY TABLE.                             |       |       |            |          |

    |   2.   LOAD SELECT ACE |                             |       |       |            |          |

    |   3.    QUICK DOUBLE |                             |     1.       |     2 (0) | 00:00:01 |

    |   4.   GLOBAL TRI |                             |     1.    13.            |          |

    |   5.    VIEW                          |                             |     1.    13.     3 (34) | 00:00:01 |

    |   6.     HASH GROUP BY.                             |     1.    16.     3 (34) | 00:00:01 |

    |*  7 |      CONNECT TO WITHOUT FILTERING.                             |       |       |            |          |

    |   8.       COUNT                      |                             |       |       |            |          |

    |   9.        VIEW                      |                             |     1.    16.     2 (0) | 00:00:01 |

    |  10.         TABLE ACCESS FULL | SYS_TEMP_0FD9D86CF_5F8521E2 |     1.    44.     2 (0) | 00:00:01 |

    ----------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    7 filter (LEVEL<>

    explain plan for

    with the data as

    (

    Select to_date (June 27, 2013 ',' DD/MM/YYYY ') from_dt, to_date (August 20, 2013 ',' DD/MM/YYYY ') to_dt, amt double 3214

    )

    Select sum (DM)

    de)

    Select from_dt, to_dt, start_dt, last_dt,

    (last_dt-start_dt + 1) * sum (round ((amt/12)/to_char (last_day (curr_dt), 'JJ') 2)), in the sm (partition to_char (curr_dt, 'MM'))

    de)

    Select from_dt, to_dt, TN,

    less (add_months (from_dt, level - 1), to_dt) curr_dt,.

    decode (level 1, less (add_months (from_dt, level - 1), to_dt), trunc (less (add_months (from_dt, level - 1), to_dt), 'MM')) start_dt;

    less (last_day (add_months (from_Dt, level - 1)), to_dt) last_dt

    from the data

    connect by level<= months_between(trunc(to_dt,="" 'mm'),="" trunc(from_dt,="" 'mm'))="" +="">

    )

    );

    Hash value of plan: 1669308594

    -----------------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

    -----------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |      |     1.    13.     3 (34) | 00:00:01 |

    |   1.  GLOBAL TRI |      |     1.    13.            |          |

    |   2.   VIEW                           |      |     1.    13.     3 (34) | 00:00:01 |

    |   3.    KIND OF WINDOW.      |     1.    30.     3 (34) | 00:00:01 |

    |   4.     VIEW                         |      |     1.    30.     2 (0) | 00:00:01 |

    |*  5 |      CONNECT TO WITHOUT FILTERING.      |       |       |            |          |

    |   6.       QUICK DOUBLE |      |     1.       |     2 (0) | 00:00:01 |

    -----------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    5 filter (LEVEL<>

    Post edited by: PurveshK
    Updated with explanation.

  • Timer counter to calculate the amount of liquid dosage

    I have a simple program of command VICI pump more interface series.

    The problem for me is that I need to see the amount of liquid dosed. I based it on 'elapsed time' express vi.

    But unfortunately it works the way I need. When I press the start of pump, it starts counting time and in a result of the liquid volume. When I press stop volume stops, but when I press Start pump once again as he continues the volume not the moment I stopped, but given the time elapsed since the first departure.

    I know that it is because the elapsed time is still running. I couldn't find a way to break it.

    Is there a way around it?

    I'm using LabView 8.6.

    Sergey,

    When you press Stop, the VI stops running. Are your referring to set up the Run on False switch?

    I put the volume (ml Injected?) on a register to shift and add the amount distributed to each iteration.  The calculation would be based time yet incremental time rather than total elapsed time.

    I don't think there is a direct way to interrupt the past Time.vi. You can store the difference between time and elapsed time in a shift register when you enter the mode pause and then use this difference as the new time target when you restart.

    Lynn

  • How can I calculate the amount of download and upload traffic within a single session?

    Hi, I would like to calculate how much the traffic of data (in bytes) that I use a session (time).
    Mind you, I speak not of connection speed.
    I guess I have sum download traffic to forward traffic, but I don't know where I can find it in my Firefox or my OS, and Linux.
    Can you help me?

    This is due to the use of a provider with a download bandwidth limits?

    There is an Extension Point called 'Net use'
    https://addons.Mozilla.org/firefox/addon/NET-usage-item/
    http://netusage.iau5.com/

  • Need to create a derived metric to calculate the amount of memory in GB

    Hi team,

    We would like to know how we can create a Derived metric to determine the usage of the memory of a specific host in the UK, I have a host who, as 80 GB memory and I need to create an alert when usage exceeds 40 GB...

    I saw the Option for the used memory capacity but it shows in Mo... How to convert the same into GB

    Concerning

    Sriram S

    You need not create a metric derived to do what you want.  Who would try too hard.

    Memory is usually stored in Foglight in megabytes.

    Just write the rule to create the alert when it exceeds (40 * 1024) MB.

  • calculate the amount of nodes in the XMLTYPE column

    I'm in ORACLE 10 g 10.2.0.4.0

    There is a table BOOK)
    ID NUMBER (10.0).
    XML_COLUMN XMLTYPE)

    XML_COLUMN looks like

    < Book bookCode = Classtest "ae1" = "0" title = "MasteringChemistry for 1st Averill/Eldredge" >
    < description / >
    < sectionTierLabels >
    < sectionTier label = "Left" >
    < sectionTier label = "Chapter1" >
    < sectionTier label = "Chapter 2" >
    .
    .
    .
    < sectionTier label = "Section" / >
    < / sectionTier >
    < / sectionTier >
    < / sectionTierLabels >
    < / book >

    Different records has a different number of chapters.

    I should get a result like

    Label sectionTier BOOKID
    1234 1 part
    1234 2 Chapter 1
    1234 3 Chapter 2
    1234 section 4
    1111 1 part
    1111 2 Chapter 1
    1111 3 Chapter 2
    4 1111 Chapter 3
    1111 section 5

    No idea how to do it?

    Thank you
    Julia

    Published by: 795070 on Sep 17, 2010 11:33

    Published by: 795070 on Sep 17, 2010 11:49

    Published by: 795070 on Sep 17, 2010 12:08

    Hello

    Strange structure for your XML data, are really nested elements sectionTier or is it a mistake?
    If the first case, try the following:

    SELECT b.bookid, x.*
    FROM book b,
         XMLTable(
          '/book/sectionTierLabels//sectionTier'
          passing b.xml_column
          columns
           sectionTier for ordinality,
           label       varchar2(30) path '@label'
         ) x
    ;
    
  • How do I know the amount of data to be persisted?

    Hi all

    I am building an application that also has a Jabber client. I want to keep the history of cats, but I don't know how much data persists.

    Is there a guide on how to calculate the amount of data to be persisted?

    I'm working with JDE Plugin on Eclipse 3.4 4.5, develop for "BOLD" and curve.

    Thank you

    -fr4gus

    You're not really serialization or deserialization anything. Simply read the lines of the file in your data structure and come back when you want to write again outside the disk.

  • Calculate the sum of the duration stored in format HH24

    Dear professionals,

    I use Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production. I stored length of certain events in the table TIME_DURATION as as follows (format h24:mi):

    CREATE TABLE "TIME_DURATION" ("ID" NUMBER(11,0), "HOURSMINUTES" VARCHAR2(5));
    
    Insert into TIME_DURATION (ID,HOURSMINUTES) values ('5','00:55');
    Insert into TIME_DURATION (ID,HOURSMINUTES) values ('7','00:18');
    Insert into TIME_DURATION (ID,HOURSMINUTES) values ('9','06:34');
    Insert into TIME_DURATION (ID,HOURSMINUTES) values ('15','00:12');
    Insert into TIME_DURATION (ID,HOURSMINUTES) values ('17','09:50');
    INSERT INTO TIME_DURATION (ID,HOURSMINUTES) VALUES ('41','12:39');
    

    select * from time_duration;
    
            ID HOURS
    ---------- -----
             5 00:55
             7 00:18
             9 06:34
            15 00:12
            17 09:50
            41 12:39
    
    6 rows selected.
    

    Now, I want to calculate the total time for all events (sum of all specific times). In this case, it should be 30 hours and 38 minutes.

    Any help would be much appreciated.

    Thanks in advance.

    Hello

    So, you want to add a number of lines varibale.  This sounds like a job for the SUM function.  AMOUNT of work on numbers, no channels such as time, so use TO_NUMBER to convert strings to numbers, so you can add them.  If you want to display the result as a string, you can use TO_CHAR to convert the sum into a string.

    WITH got_total_minutes AS

    (

    SELECT SUM ((TO_NUMBER (SUBSTR (heure, 1, 2) * 60)))

    + TO_NUMBER (SUBSTR (hour 4))

    ) AS total_minutes

    OF time_duration

    )

    SELECT TRUNC (total_minutes / 60). ':'

    || To_char (MOD (total_minutes, 60))

    , "FM00.

    ) AS total_hours_minutes

    OF got_total_minutes

    ;

    The output is not quite what you asked:

    TOTAL_HOURS_MINUTES

    --------------------

    30: 28

    If you really want 30:38', explain how to get it.

    This solution assumes that time always is always 5 characters (2 digits, a separator and another of 2 digits) as it is in your sample data.

    If your actual data aren't like your sample data, the same approach still works, but the SUBSTR expressions will be more complicated.

    adnanBIH wrote:

    Dear professionals,

    I use Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production. I stored length of certain events in the table TIME_DURATION as as follows (format h24:mi):

    1. CREATE TABLE 'TIME_DURATION' ('ID' NUMBER (11.0), VARCHAR2 (5)) 'HOUR '.
    2. Insert into TIME_DURATION (ID, TIME) values ('5',' 00:55 ');
    3. Insert into TIME_DURATION (ID, TIME) values ('7',' 00:18 ');
    4. ...

    Thanks for posting the CREATE TABLE and INSERT.

    ID is a NUMBER, so do not use quotes around it:

    Insert into TIME_DURATION (ID, TIME) values (5, ' 00:55 ');

    Insert into TIME_DURATION (ID, TIME) values (7, ' 00:18 ');

    ...

    Depending on how you plan to use the hour, you may want to store a NUMBER, also, or maybe an INTERVAL DAY TO SECOND.

  • 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;
    
  • Adobe Acrobat Standard DC - calculate, the value is the "sum" of

    The "text field properties / calculate / value is the 'sum' of the following fields / pinch / field selection"window does not provide any options to select. "  I formatted all the fields in the source & field sum as 'number' and out spaces in domain names.  My version of Acrobat Standard DC excludes a Sum function?  Thank you, all!

    It displayed fine. It looks good, so I don't know why there is no fields displayed when you click the button to 'Pick '. I always use the JavaScript option, but you can try the option of simplified field notation to work around the problem. You need to enter something like:

    Field1, Field2, field3 and field4

    Where are the names of the fields that you want to calculate the total, so change to match your domain names.

  • How to calculate the sum of two digital form fields based on the selection of the checkbox.

    I have a form in Acrobat Pro who needs a custom calculation. How to calculate the sum of two digital form fields based on a selection of the checkbox. I have three number fields. Field-A and B are simple one or two digits. Field-C is the sum, or the total field. I want to field-C have a control box which, when turned on and off, just gives a. gives the sum of A + B

    _ Field - 2

    _ Field - A 4

    [check] _ _ field - 6 C

    [disabled] _ _ field - 2 C

    Thank you

    The custom field C calculation script could be:

    (function () {
    
        // Get the values of the text fields, as numbers
        var v1 = +getField("A").value;
        var v2 = +getField("B").value;
    
        // Set this field's value based on the state of the check box named "CB"
        if (getField("CB").value !== "Off") {
            event.value = v1 + v2;
        } else {
            event.value = v1;
        }
    
    })();
    

    Replace 'A', 'B', and 'CB' with the real names of the fields.

  • help create dynamic measures to calculate the total amount in the form of tabluar

    Hello world

    We using apex 4.2 and start re-writing some existing applications originally designed in 3.0.   I was wondering if someone could help me with the following scenario.

    I have a tabular presentation several recording based on a collection called "species_collection".  The form allows fisherman to create an electronic ticket which contains one species, quantity, price, total of the amounts and other descriptive information on the species.  I created a dynamic action (with lots of help from this forum) to automatically update the collection when a field is changed.

    I am now in the hope of creating a dynamic action that will automatically do the following:

    • When the quantity is changed, recalculate the total of the amounts as quantity * price
    • When the price is changed, recalculate the total of the amounts as quantity * price
    • When dollars changed, recalculate the $ amount/total price.
    • When the total amount is changed, recalculate the OVERALL TOTAL

    Currently, I use embedded calls to javascript and then to application processes... but they are difficult to debug, and it seems that dynamic action could be cleaner and simpler.

    the current request is (I've included the concerned fields because it is an important application):

    SELECT
    apex_item.text(1,seq_id,'','','id="f01_'||seq_id,'','') "DeleteRow",
    seq_id,
    seq_id display_seq_id,
    .....
    apex_item.text(10,TO_NUMBER(c010),5,null, 'onchange="setTotal('||seq_id||')"','f10_'||seq_id,'') Quantity,
     
    apex_item.text(11,TO_NUMBER(c011),5,null,'onchange="getPriceBoundaries('||seq_id||')"','f11_'||seq_id,'') Price,
    
    apex_item.text(12, TO_NUMBER(c012),5,null, 'onchange="changePrice
    ('||seq_id||')" onKeyDown="selectDollarsFocus('||seq_id||',event);"','f12_'||seq_id,'') Dollars
     ......
    from apex_collections
     where collection_name = 'SPECIES_COLLECTION' order by seq_id 
    

    each field, QUANTITY, PRICE, $ has an ONCHANGE that then call the application processes that update the collection.

    <script language="JavaScript1.1" type="text/javascript">
    
    function setTotal(row)
    {
       //quantity was entered into form, get values
       var price = $x('f11_'+row);
       var total = $x('f12_'+row);
       var quantity = $x('f10_'+row);
       var nquantity = parseFloat(quantity.value);
       var ntotal;
       var nprice;
       nquantity = nquantity.toFixed(3);
       quantity.value = nquantity;
       //if quantity and price both have values calculate total and save
       if(quantity.value > 0 && price.value > 0)
       {
          ntotal = quantity.value * price.value;
          total.value = ntotal.toFixed(2);
       }
       else
       {
             //if quantity and total both have values calculate price and save
          if(quantity.value > 0 && total.value > 0)
          {
             nprice = total.value/quantity.value;
             price.value = nprice.toFixed(6);
             //check to see if the price entered falls within min/max for that species
             var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=PriceBoard',0);
             get.add('SPECIESPRICE',price.value);
             get.add('SEQUENCEID',row);
             gReturn = get.get();
             if ((gReturn == 'Price entered is too high') || (gReturn == 'Price entered is too low')){alert(gReturn);}
          }
          else  if (quantity.value > 0)
                   total.value = '';
                else
                { 
                     total.value = '';
                     quantity.value = '';
                }
       }
      //saveQPD(row);
       setOverallTotal(); 
    }
    function setOverallTotal()
    {
       var total = 0;
       var nTotal;
       for(i=1;i<=rowCount;i++)
       {
          if(parseFloat($x('f12_'+i).value) > 0)
          {
             total = total + parseFloat($x('f12_'+i).value);
          }
       }
       ntotal = total.toFixed(2);
       document.getElementById("P110_TOTAL").value = ntotal;
       var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=nullProcess',0);
       get.add('P110_TOTAL',ntotal);
       gReturn = get.get();
    }
    function getPriceBoundaries(row) 
    {
       //price was entered into form get all values
       var quantity = $x('f10_'+row);
       var price = $x('f11_'+row);
       var total = $x('f12_'+row);
       var ntotal;
       var nquantity;
       var nprice = parseFloat(price.value);
       nprice = nprice.toFixed(6);
       price.value = nprice;
       //check to see if the price entered falls within min/max for that species
       var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=PriceBoard',0);
       get.add('SPECIESPRICE',price.value);
       get.add('SEQUENCEID',row);
       gReturn = get.get();
       if ((gReturn == 'Price entered is too high') || (gReturn == 'Price entered is too low')){alert(gReturn);}
       //if quantity and price both have a value calculate the total
       if(quantity.value > 0 && price.value > 0)
       {
          ntotal = quantity.value * price.value;
          total.value = ntotal.toFixed(2);
       }
       else
       {
          //if total and price both have a value calculate the quantity
          if(total.value > 0 && price.value > 0)
          {
             nquantity = total.value/price.value;
             quantity.value = nquantity.toFixed(3);
          }
          else
          {
             if(price.value > 0)
                  total.value = '';
             else
             {
                  total.value = '';
                  price.value = '';
             }
          }
       }
       saveQPD(row);
       setOverallTotal();
    }
    function saveQPD(row)
    {
       var quantity = $x('f10_'+row).value;
       var price = $x('f11_'+row).value;
       var total = $x('f12_'+row).value;
       //save quantity
       var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=setQuantity',0);
       get.add('SETVALUE',quantity);
       get.add('SEQUENCEID',row);
       gReturn = get.get();
    //   alert(gReturn);
       //save price
       get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=setPrice',0);
       get.add('SETVALUE',price);
       get.add('SEQUENCEID',row);
       gReturn = get.get();
    //   alert(gReturn);
       //save total
       var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=setTotal',0);
       get.add('SETVALUE',total);
       get.add('SEQUENCEID',row);
       gReturn = get.get();
    //   alert(gReturn);
       
    }
    function changePrice(row)
    {
       //total was entered get all rows
       var quantity = $x('f10_'+row);
       var price = $x('f11_'+row);
       var total = $x('f12_'+row);  
       var ntotal = parseFloat(total.value);   
       var nprice;
       var nquantity;
       ntotal = ntotal.toFixed(2);
       total.value = ntotal;
       //if quantity and total were entered calculate price.
       if (quantity.value > 0 && total.value > 0)
       {
          nprice = total.value / quantity.value; 
          price.value = nprice.toFixed(6); 
          var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=PriceBoard',0);
          get.add('SPECIESPRICE',price.value);
          get.add('SEQUENCEID',row);
          gReturn = get.get();
             if ((gReturn == 'Price entered is too high') || (gReturn == 'Price entered is too low')){alert(gReturn);} 
       }
       //if price and total were entered calculate quantity.
       if (price.value > 0 && total.value > 0)
       {
          nquantity = total.value / price.value;  
          quantity.value = nquantity.toFixed(3);
       }
       if (price.value > 0 && quantity.value > 0)
       {
           ntotal = quantity.value * price.value;
           total.value = ntotal.toFixed(2);
       }
     
           
       saveQPD(row);
       setOverallTotal();        
    }
    
    function selectDollarsFocus(pRow,event)
    {
        tabPress = 0;
        KeyCheck(event);
        if($x('f11_'+ pRow))
        {
                if(KeyID == 9)
                {
                    $x('f14_'+ pRow).focus();
                    onFocusAreaFished(pRow);
                    tabPress = 1;
                }
        }
        else
        {
            if($x('f18_'+ pRow))
            {
                    if(KeyID == 9)
                    {
                        $x('f18_'+ pRow).focus();
                        tabPress = 1;
                    }
            }
            else
            {
                if(--pRow <= rowCount)
                    if(KeyID == 9)
                    {
                        $x('f08_'+ pRow).focus();
                        tabPress = 1;
                    }
            }
            
        }
    }
    
    
    
    </script>
    

    I'm not very familiar with javascript... but looks like there must be a simpler way.   Any thoughts on how I could address the issue?   Thank you!

    I have it.  trial and error.

    the DYNAMICS of the evolution of prices and the $ action are now two separate dynamic actions.

    Action DYNAMICS to update the column from the collection is now last... and it seems that everything works... until I have change something again.

    Thanks again for your help.

    Karen

  • Calculate the sum of the columns

    Hello!

    Am using jdeveloper 11.1.2.1

    I created a table VO based EO. I need to calculate the sum of the column named price.

    I use the expression PoView.sum ("Price"). In this PoView is the name of VO and the price is the name of the column.

    While spin AMModule I got an exception like

    PoView name not found in the given object.

    Hello

    You must use the name accessor EO or VO instead of the name of VO.
    See https://blogs.oracle.com/adf/entry/using_groovy_aggregate_functions_in (there are even the same error message in one of the comments of this blog)

    concerning
    Peter

  • calculate the deduction using the percentage and amount

    I have a dynamic form with three fields decimal:

    grossamount (grossamount)

    percentage of deduction (fwpercent)

    amount of the deduction (fwamount)

    I have the following scripts:

    Form1. #subform [0]. fwpercent::calculate - (FormCalc, client)

    fwamount/grossamount*100

    Form1. #subform [0]. fwamount::calculate - (FormCalc, client)

    grossamount*fwpercent/100

    I want to be able to change the amount or percentage and have it calculate the other, as shown in the scripts. If I open the form and taken in 100 for the gross amount, then 10 percent, the script works correctly, and 10 will be displayed in the w/h quantity. If I go to the fw amount field and replace it with 20, the percentage field still shows 10. the results are the same, if I make first, and then changes the percentage value but does not update if I do update percentage. This will only work for everything that I do everything first. I can't always fields depend on eachother whenever one of them is changed?

    changed for the scripts below and it works as expected:

    Form1. PaymentInfo.FederalWithholdingPercentage::exit - (JavaScript, client)

    FederalWithholding.rawValue=GrossAmount.rawValue*FederalWithholdingPercentage.rawValue/100;

    Form1. PaymentInfo.FederalWithholding::exit - (JavaScript, client)

    FederalWithholdingPercentage.rawValue=FederalWithholding.rawValue/GrossAmount.rawValue*100;

Maybe you are looking for