How to find the sum of an advanced table column?
Hi All,
Good Morning..
I have requirement where i need to calculate the sum of a column in an advanced table.and i need to put that value into some other field.
i am doing customization so i can't touch the Standard page properties.so i need to achieve it through Pro-grammatically..
my column name is unit price in the advanced table region.so i need the code to calculate the sum of the unit price.
Thanks in advance
Bharat
Hi Bharat,
No need for Programatic way as Advanced Table already provides this facility.
The following steps describe how to enable Totaling for a column in the footer of an advanced table.
Step 1: In the Structure pane of OA Extension, select the column container for which you want to enable Totaling Any column except for the first column can be totaled. Set the Total Value property for this column container to True.
Step 2: In the Structure pane, select your advancedTable region and choose New > footer from the context menu. OA Extension creates an advancedTables Components folder containing a footer named child, that contains a tablefooter container (labeled tableFooter1).
Step 3: Select the tableFooter container and choose New > total from the context menu. OA Extension creates a tableFooter Components folder containing a total named child, that contains a new totalRow item as shown in the figure below.
Please let me know if you are still unable to get the Total Column
HTH,
Regards,
Syed.
Similar Messages
-
How to find the level of each child table in a relational model?
Earthlings,
I need your help and I know that, 'yes, we can change'. Change this thread to a answered question.
So: How to find the level of each child table in a relational model?
I have a relacional database (9.2), all right?!
O /* This is a child who makes N references to each of the follow N parent tables (here: three), and so on. */
/↑\ Fks
O"O O" <-- level 2 for first table (circle)
/↑\ Fks
"o"o"o" <-- level 1 for middle table (circle)
↑ Fk
"º"Tips:
- each circle represents a table;
- red tables no have foreign key
- the table in first line of tree, for example, has level 3, but when 3 becomes N? How much is N? This's the question.
I started thinking about the following:
First I have to know how to take the children:
select distinct child.table_name child
from all_cons_columns father
join all_cons_columns child
using (owner, position)
join (select child.owner,
child.constraint_name fk,
child.table_name child,
child.r_constraint_name pk,
father.table_name father
from all_constraints father, all_constraints child
where child.r_owner = father.owner
and child.r_constraint_name = father.constraint_name
and father.constraint_type in ('P', 'U')
and child.constraint_type = 'R'
and child.owner = 'OWNER') aux
using (owner)
where child.constraint_name = aux.fk
and child.table_name = aux.child
and father.constraint_name = aux.pk
and father.table_name = aux.father;Thinking...
Let's Share!
My thanks in advance,
Philips
Edited by: BluShadow on 01-Apr-2011 15:08
formatted the code and the hierarchy for readbilityJustin,
Understood.
Nocycle not work in 9.2 and, even that would work, would not be appropriate.
With your help, I decided a much simpler way (but there is still a small problem, <font color=red>IN RED</font>):
-- 1
declare
type udt_roles is table of varchar2(30) index by pls_integer;
cRoles udt_roles;
begin
execute immediate 'create user philips
identified by philips';
select granted_role bulk collect
into cRoles
from user_role_privs
where username = user;
for i in cRoles.first .. cRoles.count loop
execute immediate 'grant ' || cRoles(i) || ' to philips';
end loop;
end;
-- 2
create table philips.root1(root1_id number,
constraint root1_id_pk primary key(root1_id)
enable);
grant all on philips.root1 to philips;
create or replace trigger philips.tgr_root1
before delete or insert or update on philips.root1
begin
null;
end;
create table philips.root2(root2_id number,
constraint root2_id_pk primary key(root2_id)
enable);
grant all on philips.root2 to philips;
create or replace trigger philips.tgr_root2
before delete or insert or update on philips.root2
begin
null;
end;
create table philips.node1(node1_id number,
root1_id number,
node2_id number,
node4_id number,
constraint node1_id_pk primary key(node1_id)
enable,
constraint n1_r1_id_fk foreign key(root1_id)
references philips.root1(root1_id) enable,
constraint n1_n2_id_fk foreign key(node2_id)
references philips.node2(node2_id) enable,
constraint n1_n4_id_fk foreign key(node4_id)
references philips.node4(node4_id) enable);
grant all on philips.node1 to philips;
create or replace trigger philips.tgr_node1
before delete or insert or update on philips.node1
begin
null;
end;
create table philips.node2(node2_id number,
root1_id number,
node3_id number,
constraint node2_id_pk primary key(node2_id)
enable,
constraint n2_r1_id_fk foreign key(root1_id)
references philips.root1(root1_id) enable,
constraint n2_n3_id_fk foreign key(node3_id)
references philips.node3(node3_id) enable);
grant all on philips.node2 to philips;
create or replace trigger philips.tgr_node2
before delete or insert or update on philips.node2
begin
null;
end;
create table philips.node3(node3_id number,
root2_id number,
constraint node3_id_pk primary key(node3_id)
enable,
constraint n3_r2_id_fk foreign key(root2_id)
references philips.root2(root2_id) enable);
grant all on philips.node3 to philips;
create or replace trigger philips.tgr_node3
before delete or insert or update on philips.node3
begin
null;
end;
create table philips.node4(node4_id number,
node2_id number,
constraint node4_id_pk primary key(node4_id)
enable,
constraint n4_n2_id_fk foreign key(node2_id)
references philips.node2(node2_id) enable);
grant all on philips.node4 to philips;
create or replace trigger philips.tgr_node4
before delete or insert or update on philips.node4
begin
null;
end;
-- out of the relational model
create table philips.node5(node5_id number,
constraint node5_id_pk primary key(node5_id)
enable);
grant all on philips.node5 to philips;
create or replace trigger philips.tgr_node5
before delete or insert or update on philips.node5
begin
null;
end;
-- 3
create table philips.dictionary(table_name varchar2(30));
insert into philips.dictionary values ('ROOT1');
insert into philips.dictionary values ('ROOT2');
insert into philips.dictionary values ('NODE1');
insert into philips.dictionary values ('NODE2');
insert into philips.dictionary values ('NODE3');
insert into philips.dictionary values ('NODE4');
insert into philips.dictionary values ('NODE5');
--4
create or replace package body philips.pck_restore_philips as
procedure sp_select_tables is
aExportTablesPhilips utl_file.file_type := null; -- file to write DDL of tables
aExportReferencesPhilips utl_file.file_type := null; -- file to write DDL of references
aExportIndexesPhilips utl_file.file_type := null; -- file to write DDL of indexes
aExportGrantsPhilips utl_file.file_type := null; -- file to write DDL of grants
aExportTriggersPhilips utl_file.file_type := null; -- file to write DDL of triggers
sDirectory varchar2(100) := '/app/oracle/admin/tace/utlfile'; -- directory \\bmduhom01or02
cTables udt_tables; -- collection to store table names for the relational depth
begin
-- omits all referential constraints:
dbms_metadata.set_transform_param(dbms_metadata.session_transform, 'REF_CONSTRAINTS', false);
-- omits segment attributes (physical attributes, storage attributes, tablespace, logging):
dbms_metadata.set_transform_param(dbms_metadata.session_transform, 'SEGMENT_ATTRIBUTES', false);
-- append a SQL terminator (; or /) to each DDL statement:
dbms_metadata.set_transform_param(dbms_metadata.session_transform, 'SQLTERMINATOR', true);
-- create/open files for export DDL:
aExportTablesPhilips := utl_file.fopen(sDirectory, 'DDLTablesPhilips.pdc', 'w', 32767);
aExportReferencesPhilips := utl_file.fopen(sDirectory, 'DDLReferencesPhilips.pdc', 'w', 32767);
aExportIndexesPhilips := utl_file.fopen(sDirectory, 'DDLIndexesPhilips.pdc', 'w', 32767);
aExportGrantsPhilips := utl_file.fopen(sDirectory, 'DDLGrantsPhilips.pdc', 'w', 32767);
aExportTriggersPhilips := utl_file.fopen(sDirectory, 'DDLTriggersPhilips.pdc', 'w', 32767);
select d.table_name bulk collect
into cTables -- collection with the names of tables in the schema philips
from all_tables t, philips.dictionary d
where owner = 'PHILIPS'
and t.table_name = d.table_name;
-- execution
sp_seeks_ddl(aExportTablesPhilips,
aExportReferencesPhilips,
aExportIndexesPhilips,
aExportGrantsPhilips,
aExportTriggersPhilips,
cTables);
-- closes all files
utl_file.fclose_all;
end sp_select_tables;
procedure sp_seeks_ddl(aExportTablesPhilips in utl_file.file_type,
aExportReferencesPhilips in utl_file.file_type,
aExportIndexesPhilips in utl_file.file_type,
aExportGrantsPhilips in utl_file.file_type,
aExportTriggersPhilips in utl_file.file_type,
cTables in out nocopy udt_tables) is
cDDL clob := null; -- colletion to save DDL
plIndex pls_integer := null;
sTableName varchar(30) := null;
begin
for i in cTables.first .. cTables.count loop
plIndex := i;
sTableName := cTables(plIndex);
* Retrieves the DDL and the dependent DDL into cDDL clob *
* for the selected table in the collection, and writes to file.*
begin
cDDL := dbms_metadata.get_ddl('TABLE', sTableName, 'PHILIPS');
sp_writes_ddl(aExportTablesPHILIPS, cDDL);
exception
when dbms_metadata.object_not_found then
null;
end;
begin
cDDL := dbms_metadata.get_dependent_ddl('REF_CONSTRAINT', sTableName, 'PHILIPS');
sp_writes_ddl(aExportReferencesPhilips, cDDL);
exception
when dbms_metadata.object_not_found2 then
null;
end;
begin
cDDL := dbms_metadata.get_dependent_ddl('INDEX', sTableName, 'PHILIPS');
sp_writes_ddl(aExportIndexesPhilips, cDDL);
exception
when dbms_metadata.object_not_found2 then
null;
end;
begin
cDDL := dbms_metadata.get_dependent_ddl('OBJECT_GRANT', sTableName, 'PHILIPS');
sp_writes_ddl(aExportGrantsPhilips, cDDL);
exception
when dbms_metadata.object_not_found2 then
null;
end;
begin
cDDL := dbms_metadata.get_dependent_ddl('TRIGGER', sTableName, 'PHILIPS');
sp_writes_ddl(aExportTriggersPhilips, cDDL);
exception
when dbms_metadata.object_not_found2 then
null;
end;
end loop;
end sp_seeks_ddl;
procedure sp_writes_ddl(aExport in utl_file.file_type,
cDDL in out nocopy clob) is
pLengthDDL pls_integer := length(cDDL);
plQuotient pls_integer := null;
plRemainder pls_integer := null;
begin
* Register variables to control the amount of lines needed *
* for each DDL and the remaining characters to the last row. *
select trunc(pLengthDDL / 32766), mod(pLengthDDL, 32766)
into plQuotient, plRemainder
from dual;
* Join DDL in the export file. *
* ps. 32766 characters + 1 character for each line break. *
-- if the size of the DDL is greater than or equal to limit the line ...
if plQuotient >= 1 then
-- loops for substring (lines of 32766 characters + 1 break character):
for i in 1 .. plQuotient loop
utl_file.put_line(aExport, substr(cDDL, 1, 32766));
-- removes the last line, of clob, recorded in the buffer:
cDDL := substr(cDDL, 32767, length(cDDL) - 32766);
end loop;
end if;
* If any remains or the number of characters is less than the threshold (quotient = 0), *
* no need to substring. *
if plRemainder > 0 then
utl_file.put_line(aExport, cDDL);
end if;
-- record DDL buffered in the export file:
utl_file.fflush(aExport);
end sp_writes_ddl;
begin
-- executes main procedure:
sp_select_tables;
end pck_restore_philips;<font color="red">The problem is that I still have ...
When creating the primary key index is created and this is repeated in the file indexes.
How to avoid?</font> -
How to find the structural difference between two tables
Hi all,
How to find the structural difference between two tables .
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for 32-bit Windows: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
Thanks,
P Prakashyou could try something similar to this, for each table pair that you want to compare:
SELECT 'TABLE_A has these columns that are not in TABLE_B', DIFF.*
FROM (
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_A'
MINUS
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_B'
) DIFF
UNION
SELECT 'TABLE_B has these columns that are not in TABLE_A', DIFF.*
FROM (
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_B'
MINUS
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_A'
) DIFF;that's assuming, column_name, data_type and data_length are all you want to compare on. -
How to find the sum of a column
I need to find the sum of a column and use it in a different column. The following is the example.
Column names: Feedback(Good, Avg, Poor), Count(no of good, no of avg, no of poor) and %age(Feedback/sum(feedback))
I want to find the sum in Java class and also calculate the last column in java class.
Please tell me some way to do it.oh.. ok ..thanks for letting me know.. i will formulate the question in a proper way:
This is what my UI should look like:
Rating Count Percent
Excellent 2 20
Good 6 60
Poor 1 10
Bad 1 10
Now i have the following columns in the data base:
Meaning and feedback_rating.
So the following SQL Query:
SELECT hrl.meaning rating,
sum(decode(bcpi.feedback_rating, null, 0, 1)) counted
from cmp_cwb_person_info bcpi ,
hr_lookups hrl
group by hrl.meaning
will give me the result as
rating counted
Excellent 2
Good 6
Poor 1
Bad 1
Now I want a third column as percentage : Earlier we were doing this calculation in the sql query itself, so the query was like
SELECT hrl.meaning rating,
sum(decode(bcpi.feedback_rating, null, 0, 1)) counted,
sum(decode(bcpi.feedback_rating, null, 0, 1))/(max (select count (*) from cmp_cwb_person_info bcpi ,
hr_lookups hrl )) percent
from cmp_cwb_person_info bcpi ,
hr_lookups hrl
group by hrl.meaning
Hence the third column (percent) was calculated in the sql query itself.
But now i feel that the performance of the query could be improved if we get the first two columns from the database and the calculate the third column programatically in the java code.
So this is what I want to know. How can i do that? -
How to find the sum based on two variables
Hello!
I have just started using Numbers, I have a spreadsheet which lists a number of transactions.
On my chart I have Columns "Date", "Memo", "Type", and "Amount".
The Type column is a drop down list. What I want to do and find the sum for transactions that fall between a date range (i.e. months 1-3) and that match a certain "Type". I can figure out how to use the sumif function to find the sum for a date range, however I cant figure out how then to only sum only those that match a type.
Any help?Brendon,
This question arises from time to time in different situations. The answer is to first create an auxiliary column which calculates whether or not your multiple conditions have been met. In this case you have three - more than or equal a start date, less than or equal an end date, and a "Type".
I'm assuming that your dates and "type" are flexible, so an extra table to enter your search data is shown below, but these three cells could be incorporated in your main table. The formula for the auxiliary column is:
=IF(AND(Date>=Search Range :: A$2,Date<=Search Range :: B$2,Type=Search Range :: C$2),"SUM","")
All rows with the word "SUM" satisfy the three conditions. The footer row contains the sum of the values meeting the desired conditions using:
=SUMIF(Aux, “SUM”, Amount)
Obviously this has to be reworked to your situation, but the auxiliary column is the key.
pw
Message was edited by: pw1840 -
How to find the Sum based on Like Dates
Hello everyone,
Column 1 contains "Date Sent", Column 2 contains "Dates of Service" and Column 3 contains the payment "Amount" in USD. I want to write a formula that will total up the sum of payment values from column 3 based on the date of payment (Column 1).
Thanks!
JaredHi Jared,
This will do what's illustrated in your example, but has a few restrictions:
The dates must run in ascending order.
To get a total for the last date, a later date (with no corresponding amount) must be entered after the last transaction.
Formula:
Entered in D2, and filled down the rest of column D:
=IFERROR(IF(A3>A2,SUMIF($A,A2,C),""),"")
IFERROR is used to suppress the error message that arises from the formula in D10 referencing a cell in D11.
Regards,
Barry -
How to find the container in goods receipt table
hi,
how to find the number of containers with respect to each material document. After posting the material document the number of containers cannot stored in MSEG or MKPF table. i can able to find only in QALS table but how to link the material document and inspection lot.
Thanks
Muthuraman.DHi Muthuraman,
Can you check this bapi BAPI_INSPLOT_GETLIST.In this bapi there is a different selection criteria like material,material document no and all. I think you can use this for your report. Check this and post if need help.
Regards,
Madhu. -
How to find the LOCKED ROWS in a table?
Not locked objects, but for a table the locked rows.
Check below links :
http://www.jlcomp.demon.co.uk/faq/locked_rows.html
How to find the locked row.
who are waiting for same record?
HTH
Girish Sharma -
How to save the selected rows from Advance table into database
Hi
I have requirement like..
In custom page , Manager Search the Candidates and selects the candidate ROWS from advance table.
The reqt is how to save the selected multiple rows into the database.hi Reetesh,
In Custom page
Supoose the Recruiter Search is for Position Finance Mangager , it retrieves 100 rows , out of which Recruiter select 10 rows .
So in Such scenario how to save this 10 rows against Recruiter
, i mean , Is i need to create custom table, to save Recruiter , these selected 10 rows.
I hope u understand my question -
How to find the function module for standard tables.
Hi
Could any one please tell me how to find the standard function module to update the standard tables
Thanks & Regards
SowmyaHi sowmya,
To find the function modules for standard tables you go for a where used list of that particular table and check only function module interfaces checkbox...
and more over you can go for DB_UPDATE_TABLE will be the function module for updating database table..
Hope this information would help you
Regards
Narin Nandivada -
How to find the longest record in a table?
Hello,
Is there a function to find the longest record in a table? Or is there a data dictionary that would tell you which record contains the longest data?
I have a table with five columns and one million records. I want to find the record (5 columns combined) with the longest data. Thank you.Dear watson2000!
The function "VSIZE" tells you the number of bytes in the internal representation of a column which means the size of a value within a column. An example of vsize can be found here:
[http://www.adp-gmbh.ch/ora/sql/vsize.html]
So I think you should try it with this query to get the size of the longest record:
SELECT MAX(VSIZE(column1)) +
MAX(VSIZE(column2)) +
MAX(VSIZE(column3)) +
MAX(VSIZE(column4)) +
MAX(VSIZE(column5)) AS "Maximum Row"
FROM your_table;To identify the longest record try like this:
SELECT rowid
FROM your_table
GROUP BY rowid
HAVING (MAX(VSIZE(column1)) +
MAX(VSIZE(column2)) +
MAX(VSIZE(column3)) +
MAX(VSIZE(column4)) +
MAX(VSIZE(column5))) = (SELECT MAX(VSIZE(column1)) +
MAX(VSIZE(column2)) +
MAX(VSIZE(column3)) +
MAX(VSIZE(column4)) +
MAX(VSIZE(column5))
FROM your_table;)I hope that these two queries could be of help to you.
yours sincerely
Florian W.
Edited by: Florian W. on 23.04.2009 20:53 -
How to capture the row value in Advanced Table on OAF ?
Hi:
I was wondering, if anyone has any idea as to how to capture a row value on an advanced table on a OAF Page.
I am currently trying to capture the Expense Report Number ( first column) on the Track Expenses Reports table on the page /oracle/apps/ap/oie/webui/HomePG.
Any idea would be helpful ?
Thank YouHi,
856070 wrote:
This is what I am looking for :
Default Functionality
On the expenses home page there is a table for the Submitted expenses Table ( advanced table) with multiple Expense Number rows , which has a link associated with every expense number. When the user clicks the expense number link , EBS takes you to a more detail information page. ---As per default functionality :::whene ever user clicks on link it will takes u to details info page based expense no right.
---Check the property of the Destination URL of the ExpensionNumber column.
---In this property u can find the page path and paramam ex:pexpencenumber.
Customized functionality
I would like to capture the Expense number on the detailed page to call another application based on the expense number. The expense number on the
detailed page is not available on the request-parameter or on the VO.
I was thinking of capturing the ExpenseNumber when the user clicks it and save the expense number on a >transientvalue to retrieve it on the detaile dpage..but unable to do so.---Here get the paramereter pexpencenumber and pass it to another appilcation.
Regards
Meher Irk -
How to find the views created on a table..?
Hi all,
I am having one table name, EMP. I want to know what are the views created on this table. Is there any SQL query is there for this or any another
way to find it.
Thanks in advance.
PalYou can use ALL_DEPENDENCIES for that:
SQL> create view emp_v as select * from emp;
View created.
SQL> select name
2 , referenced_name
3 , referenced_type
4 from all_dependencies
5 where name = 'EMP_V';
NAME REFERENCED_NAME REFERENCED_TYPE
EMP_V EMP TABLE
1 row selected.
SQL> select name
2 , referenced_name
3 , referenced_type
4 from all_dependencies
5 where referenced_name = 'EMP';
NAME REFERENCED_NAME REFERENCED_TYPE
EMP_V EMP TABLE
EMP_TRG EMP TABLE
2 rows selected.
SQL> Keep in mind that it matters whether you restrict on NAME or on REFERENCED_NAME.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_1041.htm#sthref935
edit
Ah, spoonfeeding!
Don't you want him to learn something, and to become independent?Now you made me feel guilty ;) ( don't know what Saubhik posted originally, but anyway...)
I blame my currently terribly slow connection for that...
Anyway, OP, always start a quick search from the docs first.
Chances are you'll find your answer yourself.
Homes:
http://www.oracle.com/pls/db102/homepage
http://www.oracle.com/pls/db112/homepage
Edited by: hoek on Oct 15, 2010 2:53 PM -
How to find the Infoset associated with a table
Which table in SAP R/3 4.6c stores the table used in Infoset.
Eg: would like to see table : MSEG used in which Infoset.
I would like to know the Joins used in Infoset
Table : AQGSCAT give only the Main table used in the Infoset.
But, I would like to know where and all MSEG is usedHi,
1. BW infoset is a join between two ODS, so, there is no table.
2. BW infoset is not the same than R/3 infoset. You won't find it in SQ02
go throgh the below the link,
http://help.sap.com/saphelp_bw33/helpdata/en/ed/084e3ce0f9fe3fe10000000a114084/content.htm
Hareesh -
How to keep the cellEditor after remove/add table columns
The cellEditor/render will be invalid after fireTableStructureChange event. How to make the cellEditor work properly as before the structure changed?
After a fireTableStructureChange event the TableColumnModel is recreated and the default renderers and editors are used. If you are using custom renderers or editors you need to reinstall them for the appropriate column.
Maybe you are looking for
-
What r the steps to display check box in smartform
can anyone tell me the procedure to display the steps in smartform
-
When plugged up to charge, Mac book pro shut down and will not boot now
Im using my computer for work...then all of the sudden I get a notification telling me my battery is low so I plug it in. Then a few minutes later, my mac goes black like it had died from a dead battery. I let it charge for a few minutes and come bac
-
Can't Paste Develop Settings to Multiple Photos
I'm running Lightroom V3.2, and I have about 100 pictures I took at a concert. I tweaked the exposure, brightness, etc, and the noise reduction, and copied the develop settings. If I paste the settings onto any one photo, the paste works great. Ho
-
I want to change my body pavilion g6.
I want to change my body pavilion g6. because its body has borken. How can i do it or Where can i find it to buy?
-
Pattern / matcher question
Hi, I have this arrayList<String> arr = { "minor", "division", "substraction","maximum","minimum" } and I want to scan this file with these patterns: file.txt $inor %ubstracti*& $ini$u$ (ivisi*& $axi$u$ %ubstracti*& correcting this files. Additionaly