Accumulating Rolling Total on a column

I need to display a list of records and I'd like to create an accumulating field based on a set of records. I need to fill in amount balances that accumulates on every record. For instance, if I have these records:
Quantity
2
3
1
5
10
My aggregated column and Quantity column would look like this:
Quantity, Rolling Total
2 , 2
3     ,     5
1     ,     6
5     ,     11
10     ,     21
How can I do that?

Here look at the following example script
set echo off
-- sql to create running total using analytic function
-- 20011204 Mark D Powell New, save example.
set pagesize 90
break on dname nodup
select
d.dname
,e.ename
,e.sal
,sum(e.sal)
over (partition by e.deptno
order by e.ename
rows between unbounded preceding and current row
) as Rtotal
from
emp e
,dept d
where e.deptno = d.deptno
HTH -- Mark D Powell --

Similar Messages

  • Rolling totals query ~ please help

    I have been stuck on a query for the last week. It would be amazing if someone could help me with this. nothing I have done has worked so far.  I did post something a few days ago and was helped a bit but it just didnt work out the way I needed. This has been the hardest query I have ever worked on.
    Im using oracle 11g.
    What I am trying to do is get a bunch of running aggregate values based on dates of multiple projects.
    I have did an export of the ddl for the actual table and records, I did not want to just post a sample of the data as it includes many records and I think it might actually be easier to have the full extract.
    here is the link to the file http://santoro.us/pl_insert.sql
    In the table I have IPS (which is a project id), create date, complete date, logged_date, status, due date (these are all the important columns)
    What I am trying to get as an end result is 1 table or 1 view that has all the running totals per month for each project.
    Here are the totals im looking to get
    Open
    Closed
    open late
    closed late
    open on time closed on time
    The thing is I need to start the months per project from the first month the project has a record. So if a projects first record starts on jan 1 2010 thats when the first record with totals should be, 01/2010 , then 02/2010, 03/2010, etc..until the current month. This has to be done per project.
    so for example lets say there are only 2 projects (there are many more).
    IPS 123
    first record starts 01/01/2010
    IPS 456
    first record starts 01/01/2011
    each have records that open and close on different dates in different months. some might be late (complete date > due date),  some closed on time (complete date <= due date).
    end result would be a table that has :
    Date |  IPS | open | closed | open late | closed late | open on time | closed on time |
    01/2010 | 123 | 1 |  0 | etc..
    months would go all the way to current month
    then start proj 2
    01/2011 | 456 | 1 | 0 | etc..
    months would go all the way to current month
    each record would be counted starting the create date of the record. As the records get late or closed (based on due date and complete date) then need to be added/removed from the running totals of the data.
    This all has to be in 1 table or view. I know some people might say this is wrong way to do it but thats how it has to be done for the project im working on. Im generating xml at the end so the developer needs it like this.
    Again thank you for any help and please let me know if you need any other information.
    thank you.

    Frank. No problem. that is great that it doesnt need ad hoc tables and could be done in pure sql. As I said this is the hardest query i have ever worked on. If you could help i would be greatful. I realize this forum is priceless resource and has helped me many times.
    Please let me know if I should post anything else.
    I am having a hard time understanding how I would dispaly each month with the aggregrated rolling totals from start month to current month for each project.
    Im using oracle 11.2.3.3.0
    CREATE TABLE "THERM_PUNCHLIST"
       ( "ENTRY_ID" VARCHAR2(50 BYTE),
      "BATCH_DATE" DATE,
      "IPS" VARCHAR2(50 BYTE),
      "STATUS" VARCHAR2(20 BYTE),
      "DUE_DATE" DATE,
      "UNIT_SERIAL" VARCHAR2(500 BYTE),
      "CREATE_DATE" DATE,
      "COMPLETE_DATE" DATE,
      "DB_LOGGED_DATE" DATE,
      "REPORTED_DATE" DATE
    --im posting more than 20 inserts as i want to be sure to get a few projects. the full ddl is at the link above with all projects and records
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788396',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('27-MAY-11','DD-MON-RR'),null,to_date('12-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('12-JUN-08','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788387',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('27-MAY-11','DD-MON-RR'),null,to_date('12-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('12-JUN-08','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788391',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('27-MAY-11','DD-MON-RR'),null,to_date('12-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('12-JUN-08','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788372',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('27-MAY-11','DD-MON-RR'),null,to_date('12-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('12-JUN-08','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788375',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('27-MAY-11','DD-MON-RR'),null,to_date('12-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('12-JUN-08','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788385',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('27-MAY-11','DD-MON-RR'),null,to_date('12-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('12-JUN-08','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788356',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('27-MAY-11','DD-MON-RR'),null,to_date('12-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('12-JUN-08','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788360',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('27-MAY-11','DD-MON-RR'),null,to_date('12-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('12-JUN-08','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788338',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('26-JAN-11','DD-MON-RR'),null,to_date('25-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('25-JUN-08','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788317',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('26-JAN-11','DD-MON-RR'),null,to_date('29-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('29-JUN-08','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2305623588',to_date('28-JAN-14','DD-MON-RR'),'505587','Closed',to_date('31-JAN-11','DD-MON-RR'),'875032 / 875034',to_date('09-JUN-10','DD-MON-RR'),to_date('08-JUL-10','DD-MON-RR'),to_date('02-MAR-11','DD-MON-RR'),to_date('09-JUN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('4073131813',to_date('28-JAN-14','DD-MON-RR'),'504984','Closed',to_date('15-MAY-12','DD-MON-RR'),'E0839',to_date('17-FEB-12','DD-MON-RR'),to_date('31-MAR-12','DD-MON-RR'),to_date('18-APR-12','DD-MON-RR'),to_date('12-DEC-11','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2305592103',to_date('28-JAN-14','DD-MON-RR'),'505587','Closed',to_date('31-JAN-11','DD-MON-RR'),'875032 / 875034',to_date('08-JAN-10','DD-MON-RR'),to_date('23-JUL-10','DD-MON-RR'),to_date('02-MAR-11','DD-MON-RR'),to_date('08-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2305592105',to_date('28-JAN-14','DD-MON-RR'),'505587','Closed',to_date('31-JAN-11','DD-MON-RR'),'875032 / 875034',to_date('08-JAN-10','DD-MON-RR'),to_date('12-JUL-10','DD-MON-RR'),to_date('02-MAR-11','DD-MON-RR'),to_date('08-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2305592108',to_date('28-JAN-14','DD-MON-RR'),'505587','Closed',to_date('31-JAN-11','DD-MON-RR'),'875032 / 875034',to_date('08-JAN-10','DD-MON-RR'),to_date('12-JUL-10','DD-MON-RR'),to_date('02-MAR-11','DD-MON-RR'),to_date('08-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2305592101',to_date('28-JAN-14','DD-MON-RR'),'505587','Closed',to_date('31-JAN-11','DD-MON-RR'),'875032 / 875034',to_date('08-JAN-10','DD-MON-RR'),to_date('12-JUL-10','DD-MON-RR'),to_date('02-MAR-11','DD-MON-RR'),to_date('08-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2305592087',to_date('28-JAN-14','DD-MON-RR'),'505587','Closed',to_date('31-JAN-11','DD-MON-RR'),'875032 / 875034',to_date('08-JAN-10','DD-MON-RR'),to_date('12-JUL-10','DD-MON-RR'),to_date('02-MAR-11','DD-MON-RR'),to_date('08-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2305592096',to_date('28-JAN-14','DD-MON-RR'),'505587','Closed',to_date('31-JAN-11','DD-MON-RR'),'875032 / 875034',to_date('08-JAN-10','DD-MON-RR'),to_date('12-JUL-10','DD-MON-RR'),to_date('02-MAR-11','DD-MON-RR'),to_date('08-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2305592099',to_date('28-JAN-14','DD-MON-RR'),'505587','Closed',to_date('31-JAN-11','DD-MON-RR'),'875032 / 875034',to_date('08-JAN-10','DD-MON-RR'),to_date('12-JUL-10','DD-MON-RR'),to_date('02-MAR-11','DD-MON-RR'),to_date('08-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('3652122705',to_date('28-JAN-14','DD-MON-RR'),'704145','Closed',to_date('01-SEP-10','DD-MON-RR'),null,to_date('13-JUN-10','DD-MON-RR'),to_date('25-APR-11','DD-MON-RR'),to_date('07-FEB-12','DD-MON-RR'),to_date('13-JUN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('3652122696',to_date('28-JAN-14','DD-MON-RR'),'704145','Closed',to_date('01-SEP-10','DD-MON-RR'),null,to_date('13-JUN-10','DD-MON-RR'),to_date('25-APR-11','DD-MON-RR'),to_date('07-FEB-12','DD-MON-RR'),to_date('13-JUN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('3652122693',to_date('28-JAN-14','DD-MON-RR'),'704145','Closed',to_date('01-SEP-10','DD-MON-RR'),null,to_date('13-JUN-10','DD-MON-RR'),to_date('25-APR-11','DD-MON-RR'),to_date('07-FEB-12','DD-MON-RR'),to_date('13-JUN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('4904513300',to_date('28-JAN-14','DD-MON-RR'),'708829','Closed',to_date('04-OCT-12','DD-MON-RR'),'890273',to_date('04-JUL-12','DD-MON-RR'),to_date('09-APR-12','DD-MON-RR'),to_date('05-SEP-12','DD-MON-RR'),to_date('04-JUL-12','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785374403',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('19-FEB-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785375257',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('19-FEB-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785377988',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249843931',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('11-OCT-10','DD-MON-RR'),to_date('02-APR-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('11-OCT-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785384765',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785385084',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785388821',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785388837',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785393519',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-MAR-12','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('28-FEB-12','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785393585',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-MAR-12','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('28-FEB-12','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785375310',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785375318',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785375324',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785378644',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785382711',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249843992',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('20-AUG-10','DD-MON-RR'),to_date('28-JAN-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249843996',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('20-AUG-10','DD-MON-RR'),to_date('23-FEB-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249844002',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('14-MAY-10','DD-MON-RR'),to_date('01-FEB-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('14-MAY-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249843984',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('20-AUG-10','DD-MON-RR'),to_date('03-JUN-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249843968',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('10-SEP-10','DD-MON-RR'),to_date('14-JAN-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('10-SEP-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249843921',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('20-AUG-10','DD-MON-RR'),to_date('28-JAN-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249843913',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('20-AUG-10','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'));
    Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249843897',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('20-AUG-10','DD-MON-RR'),to_date('03-JUN-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'));

  • Get Total of a Column of Advanced Table and use it in Controller in OAF

    I have an advanced table on my custom page. I am calculating total of a column in my footer. I am acheiving this using the standard functionality of advanced table by setting total value property of my column to "TRUE" and displaying the total in the tablefooter components.
    In addition to this I want to retreive the total value from my footer and use it in my Controller for further validations but I am not able to acheive this.
    I tried some code already present in the Community for the same but nothing turned out right for me.
    Can anyone please help me on this.

       Hi there ,
      You can manually add the values of each row of a  column and make use of the value obtained in your controller .
    Here is the logic ,
    1) get the vo instnace attached to that table .
    2) Loop through every single row in the table .
    3) get the value and sum up the value and use it in your controller .
    int fetchRowCount = vo.getFetchRowCount();  
    voRowImpl row = null;  
    int count =0;
    if (fetchRowCount  > 0) { 
    RowSetIterator iter = vo.createRowSetIterator("Iter"); 
    iter.setRangeStart(0);
      iter.setRangeSize(fetchBidderRowCount);
       for (int i = 0; i < fetchBidderRowCount; i++) {
      row = voRowImpl iter.getRowAtRangeIndex(i);
       //use RowImpl getters   10.   
             Number personId = row.getPersonId();
    count =personId+count;         // add each and every value and have in variable
    iter.closeRowSetIterator();
    Regards ,
    Keerthi

  • Analysis report with totals on specific columns

    I have an analysis report that I need to create totals on specific columns. If I turn on "Grand Totals" from the "Edit View: Table" section, all of the numeric columns will display grand totals. This is a nice automatic feature, but I only need totals of specific columns. Not all numeric columns need totals nor do Grand Totals of some columns make any sense.
    For example, to display opportunity details, we will have on the report:
    Opportunity Name, Item number, Item Description, Quantity, Price, Extended Price
    Since the opportunity may have multiple items on it, having a grand total of quantity and unit price makes no sense. All we need is Grand Total of the opportunity extended price.
    Is there a way to selectively turn on/off column totals or is it an all or nothing option?
    Thanks in advance.
    Edited by: nsidev on Sep 1, 2009 10:10 AM

    Actually, i just solved the problem.
    Here is what I did:
    1. I added a column to the "Design Criteria" section (step 1). To keep the units consistant, I made sure that the data element was suitable for the value (I used a currency element). Ensure you note the position of the new column, mine was in position 11.
    2. Under the newly added elements "Column Properties", I set it to HIDDEN and changed the name to "Grand Total"
    3. Under the "Edit Formula", I changed the formula to be: SUM(<numeric column>)
    4. In "Create Layout" (Step 2), I added a narrative view to the bottom of the page.
    5. In the "Edit Narrative View", I set the appropriate formatting and added the following: Total Extended Price: @11
    6. Ensure that "Rows to display" is set to 1.
    Save and run
    All done, works like a charm.

  • Removing Totals for Break Columns

    Hi All,
    If we add break on two or three columns in report, it gives totals for each group plus a report level total. Is there any way to remove any group or break's total.
    For example, if we have a report on emp table and having groups on deptno and job columns, it would be giving totals like this:
    JOB TOTAL:               3000
    DEPTNO TOTAL:               3000
    report total:               3000
    How can we remove any of the above totals?
    Thanks
    Zahid Khan
    Deptno

    Looks like this is a popular request!
    I have report with a break on Column 1, 2 and 3. I would like to display the Report totla but not the sub totals at each column break. Can anyone please share their experience on how to get rid of the Sub Total for a break column?
    Thanks.

  • Is it possible to create an invoive that keeps a running total in one column and in another column keep total of monies spent from a starting amount of funding?

    Is it possible to create an invoive that keeps a running total in one column and in another column keep total of monies spent from a starting amount of funding?

    Hi Sara,
    Many thanks for your reply.  We just brought Adobe Acrobat XI Pro complete
    with Adobe Forms Central, My manager asked whether I could use the forms
    part to create a summary tracking sheet for all of our contracts.
    Having looked at it I could see how to create a table that in the first
    column deleted costs from a starting fund, and in the last keeps a running
    total of all monies spent.
    I agree, Excel does seem to be much better suited to the task.  I was try
    trying to comply with her request
    Regards,

  • Can I know the name, type, total number of column in Record Group?

    I created a record group with query dynamically.
    And then populated it.
    I don't know the column' count, type, name befause I get the query from user at runtime.
    Can I know the name, type, total number of column in Record Group?

    Unfortunately, there is no way to query the record group (RG) to get the metadata you are looking for. RGs are best used as data sources to an LOV or List Item rather than as an Array to hold the resultset of a dynamic query. For this, I would recommend you use a Collection type of construct (PL/SQL Table of Records, VArray, etc).
    Craig...

  • Grand total on some column

    Hi,
    My question is: Can I exclude grand total on some measure column in pivot view?
    For example I have 3 columns.On columns Account1 and Accounts, aggregation is SUM, and on column Max(something), aggregation is MAX.
    I have next situation.
    Account1 Account 2 Max(something)
    100 200 23
    200 250 13
    150 300 42
    450 750 42 - GRAND TOTAL
    But I want grand total only on columns Account1 and Accounts. For column Max(something) I don't want total at all.
    Thank you for your replies.

    Hi,
    Thanks for your reply,
    According to the link Below
    http://gerardnico.com/wiki/dat/obiee/answer_xml,
    We can able to change color for Grand total through XML, but the example is in 10g, there is nothing call saw:totalValues in 11g Currently, may be it is replaced with saw:displayGrandTotal, I tried that option also but it is not working.
    Is there anything which we can do through xml, to achieve the above requirement?
    Thanks
    Anirban

  • Add Total to Stacked Column Chart on the top and another important thing is the data are from SharePoint site

    the same with the following description from another question:
    "How can I display a total on top of each column on a stacked column chart (using
    reporting services 2008)? If I use Data Labels I can display the
    values for each part of the stack on a stacked column, but I want to be display the total.
    For Example: If I have stacked column on chart with a value of 10 for the 1st stack, 20 for the 2nd stack,
    and 20 again for the 3rd stack - I want to display 50 (the SUM total) as the data label on top of the entire column..."
    and a solution for this would create a new column named SUM(category group), this can be done with data source from SQL server, but my data is from SharePoint site list. its query seems can't be changed which means I can't add a SUM column.
    what should I do with this? Can anyone give me a hand?
    thank you very much.

    Hi sophiexu,
    If we want to display a total for each column on the top of a stacked chart, we can use a matrix control to display the column total value to work around this issue.
    The following thread about how to simulate chart legend is for your reference:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/cfb4fa19-b2ba-426a-804b-b5ea83d70d62/ssrs-2008-chart-legend-missing-customitems-property
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Page Total for a Column in JSF HtmlDataTable

    Hi All,
    I need an example to calculate page total for price column in HtmlDataTable.
    Each page displays 10 rows and there are 50 rows hence 5 pages in datatable.How to calculate page total after displaying the rows on page.
    Thanks in advance.

    Just get the desired sublist of the datalist and sum the price? You can get the starting index and the rowcount from the HtmlDataTable by its getFirst() and getRows() methods respectively and use it in List#subList(). Then iterate over the list and add the price value of every item in a loop to the total value. You can display it in the footer of the datatable. You can define a footer with <f:facet name="footer">.

  • Calculating Totals for a column in ALV Grid Display

    Hi All,
      I frustrated with the problem of simple calculating total for a column. I wrote the following code:
      LW_CATALOG-TABNAME   = P_GV_STRUCT.
      LW_CATALOG-FIELDNAME = 'ZSUMMS'.
      LW_CATALOG-DO_SUM    = GC_X.
      APPEND LW_CATALOG TO G_FIELDCAT_TAB.
      CLEAR LW_CATALOG.
    It is not working. Could you please suggest the solution?
    It would be great help to me.
    Advanced Thanks,
    Phani Kumar

    Phani,
    Did u try playing around with any of these layout fields ?
    no_sumchoice(1),       " no choice for summing up
    no_totalline(1),       " no total line
    no_subchoice(1),       " no choice for subtotals
    no_subtotals(1),       " no subtotals possible
    no_unit_splitting  " no sep. tot.lines by inh.units
    totals_before_items,   " diplay totals before the items
    totals_only(1),        " show only totals
    totals_text(60) ,      " text for 1st col. in total line
    subtotals_text(60) ,    " text for 1st col. in subtotals
    b. Addtionally... not a solution.. but u know...
    just try the same code iwth reuse_alv_list_display and see if the total gets displayed properly ?

  • How to Remove totals on few columns from SEM BPS layout

    On SEM BPS layout it has 10 5 charatestics columns
    and 10 key figure columns.
    out of these key figures I want see totals on some
    coulmns and for few columns I do not want to see totals.
    for wxample it does not make sense of seeing total under
    the salary incrase percentage coulmn.
    Please suggest anyway we can remove total for some  
    columns on the layout

    Hey, thanks -- everything worked as you described. It never would have occurred to me that the "put back" button refers to the browser selection not the layout selection, for reasons I give below.
    I think Aperture exhibits some conceptual confusion here. First of all, a "light table" is created by the New > Light Table command, and you add images to the newly created light table just as you would add them to an album. But those images don't go on the light table layout until you drag them from the browser to the layout table. The "put back" button and "remove from light table" contextual menu command both mean remove from the layout. The phrasing of the contextual menu command make it sounds as if it will remove the clicked image from the light table's collection of images, like removing an image from an album -- it would have made more sense to name this command "put back". Furthermore, the "put back" button is above the layout display, not above the browser, which to me implies that it applies to selections in the layout display. To select an image in the browser, and click "put back selected" seems backwards -- if you just selected the image in the browser, your attention is focused on the browser, not the layout; from the browser's point of view, the button should read "bring back" not "put back".
    The documentation didn't really help when I was trying to figure this out. Sometimes the Aperture documentation refers to just a "light table", as on the overview on page 732. On pages 733 and 734, though, it refers to a "light table album". On page 735 of the Aperture manual there is a very brief explanation of how "to add images to the light table" and "to remove an image from the light table". Here, "light table" refers to the layout not the album. The explanation of the "Put Back Selected" button says to select an image then click the button, and the picture shown is of an image selected in the layout, not in the browser.

  • Poor Response Time- Total on a column for n number of rows

    I have a table with column cost on my custom OAF page.
    When I query for configuration it returns me many rows. so I have set the default rows for table = 10 and then I neatly have next button to go to other rows.
    I have enabled totalling on cost column.
    Row for Total appears showing sum for the costs only on that page( for only 10 rows). I click for next from drop down , and I see total for the costs for the second page.
    Ex:
    table has 17 rows and
    page 1 :
    total row at the end saying 1000.00
    page 2 :
    total = 1500.00
    I want to display Total Cost by summing up the costs for say 300 items returned by the query on all the pages , in above case 2500.00.
    I thought of a way to do it ;
    I added a sumVO with query "select sum(...) from table" .
    Added a new region in my page , added a messageStyleText based on the sumVO, and pulled the total cost in.
    It shows me the right result, but my problem is performance.
    It is getting very slow. I am using the same query as for displaying the results in table, but summing on cost column.
    Can I avoid writing the sum query and do it programmatically in OAF ??
    Thanks in advance.

    Even if you use programmatic approach, what do you think program will do?
    Program has to fetch all the rows in the middle tier and sum it up using for loop. No way its going to solve your problem.
    First find out the reason for the slow performance using Trace option. and fix the query.
    If your not able to fix it, try materialized view for the summation query.
    To take sql trace for OAF page refer this link infor http://prasanna-adf.blogspot.com/2009/01/sql-trace.html
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to total a cost column

    How do you add/total an expense column in Numbers?

    Wstar,
    A Numbers Table has Header and Footer cells and Body Cells. It's possible to address a row or column of body cells in its entirety without mentioning the row numbers. So, if your expenses are listed in column C you can write:
    =SUM(C)
    Body cells in column C will be summed and Header/Footer rows will be ignored. This is one of the great features of Numbers and will save you a lot of effort in programming and editing.
    Each table can have up to 5 Header columns and up to 5 Header Rows and 5 Footer Rows.
    Jerry

  • To get a total of the column

    Hi, is possible to get a total of a column that have a date ('HH24:MI:SS') format, in a REPORT?
    Because I try with the option SUM of the attributes of the region but doesn't work.
    Thank!

    I think you have to do this manually. See my post from today talking on the leading total:
    How to display TOTAL before the rows ?
    Denes Kubicek

Maybe you are looking for

  • Strange gaps in Header and Footer

    Im getting gaps in the header and footer on some of my pages.  Sometimes the gaps are filled with the background color of the colomn and other times they are the body color which is even weirder.  An example link would be http://www.mojogar.com/pcRep

  • How Do I Sync Photos With iPad Using iTunes?

    Since updating to OS X 10.10.3, iTunes 12.1.2.27, and Photos, I cannot sync any photos to any devices.  Previously, I would connect a device, choose photo albums in iTunes, and sync.  Now, I connect a device and no matter what I choose in the photos

  • Which case in LV Oper. Intf. will do "Run Selected Steps using single pass" for me?

    I added a button to simulate "Run Selected Steps", but I really want a button that will "Run Selected Steps Using Single Pass". Which case in the Complex Labview Operator Interface does this for me? What I really want is the report to be generated wh

  • Why the code in a user exit is executed twice?

    Hi all, I've got a development in a user exit EXIT_SAPMP56T_001. This user exit allows us to control the travel expenses. When you go to the TX: PR05 you can see a list with travels to add expenses. Here you can select one item on the list and press

  • Messages not being recieved &/or completely jumbled? - IOS 6.1.3

    Hi All... Ok I'm about to throw my iphone (anyone want it) I had it replaced in January (2013) due to water damage of my other iphone. I was told they were giving me a "new" phone. Since having this "new" phone I have had nothing but trouble (calls h