Getting a total or sum of numbers
I have a MD from. In the detail form, I have a field for numbers. When there are multiple rows in the detail form, how do I add or get the sum of all the numbers. I need this total to appear in the Master form in a "Total Amount" field. I think it has something to do with the Data Value type in the edit form, and writing an expression or sql for that. Don't know much about writing code.
Hi,
You can do this using javascript.
Say you have an MD form on dept and emp and you want show the sum of the salary in the master block in a column
called 'SUM'
1) Write a 'onchange' javascript event for the detail salary column like this
var l_val = 0;
var l_index = 0;
for(i=0;i<document.forms[0].length;i++)
l_name = document.forms[0].elements.name;
l_index = l_name.indexOf('MDFORM_0605210238.DETAIL_BLOCK.SAL');
if (parseInt(l_index) != -1)
alert(document.forms[0].elements[i].value);
if (document.forms[0].elements[i].value != 0)
l_val = l_val+parseInt(document.forms[0].elements[i].value);
for(i=0;i<document.forms[0].length;i++)
if (document.forms[0].elements[i].name ==
'MDFORM_0605210238.MASTER_BLOCK.SUM.01')
document.forms[0].elements[i].value =
l_val;
This code assumes that the salaray column has a default value '0'.
The above code is a just a sample to illustrate. The column names referred here are from my portal.
You should replace with your code to suit your requirements. To get the names of column look at the source of the
runtime form.
Thanks,
Sharmila
Similar Messages
-
Hi,
I want to do a query to get PO total value(sum of line item value), how to do that?
In EKPO, it will show PO+Line item value, but the user requirement is to see PO total value under 5000 local currency.
Please help, thanks.I will try again. For example, I have a table (Payments) that has 5 records. The 5 Payments table records has $24.45 entered all for the same person, Billy Bob that totals $122.25. I have a table (Members) that Billy Bob is one of 10 records. The query:QryTotalAmtDueBy
returns 1 result (record) and it is only for Billy Bob for $122.25 because he is the only one entered in the Payments table. Total Amount Due: Sum([PaymentAmount]-[PPUnionDuesAmountNoDeduct])
When I enter into the control source for text box:
TextBoxTotalAmountDueToDateTab5 the expression: =DLookUp("[Total Amount Due]","[QryTotalAmtDueBy]","[MemberID]=" & [Forms]![Branch 142 Membership]![MemberID]) on the form: Branch 142 Membership. I get the
$122.25 total amount due for Billy Bob and for the remaining 9 records in the
TextBoxTotalAmountDueToDateTab5.
You suggested I try =DLookUp("Total Amount Due","QryTotalAmtDueBy"). I get #Error when I entered it in the text box:
TextBoxTotalAmountDueToDateTab5. I modified what you gave me and entered: =DLookUp("[Total Amount Due]","[QryIndivTotalAmtDueBy]"). I still get the
$122.25 total amount due for Billy Bob and for the remaining 9 records in the Members table.
I don’t care if I use a control source that references the
Total Amount Due from the query QryTotalAmtDueBy or if I use a control source expression that is the sum
of the PaymentAmounts minus the sum of the PPUnionDuesAmountNoDeduct for each record in the Members table. I've tried:
=IIf(IsNull([MemberID]),0,DSum("[PPUnionDuesAmountNoDeduct]-[PaymentAmount]","Payments","[MemberID]=" & [MemberID])). I get nothing for
any record in the Members table. -
I am using Numbers on my iPhone5 and cannot get the app to do a simple (SUM) calculation. It shows the formula correctly in the cell, but all I get for my long list of numbers to add is 0. How can I get this to work?
Oaky, at least we got that far. Next step is to determine if all those "numbers" are really numbers. Changing the format to "number" doesn't necessarily change the string to a number. The string has to be in the form of a number. Some may appear to you and me as numbers but will not turn into "numbers" when you change the formatting from Text to Number. Unless you've manually formatted the cells to be right justified, one way to tell if it is text or a number is the justification. Text will be justified to the left, numbers will be justified to the right.
Here are some that will remain as strings:
+123
123 with a space after it.
.123 -
OBIEE11g Grand total not summing up correctly
hi all,
I have to display the grand total from the foll calculation : (total po numbers - total Recd on time PO numbers) / total PO numbers.
To get the total PO numbers - in the Edit formula - COUNT(PO numbers) and aggregation rule is set to SUM - this gives total correctly. eg : count of Total PO numbers - 15
To get the total Recd on time PO numbers-- In the edit formula fields - COUNT(Recd on time PO numbers) and aggregation rule is set to SUM . This also shows hte total correctly. Eg : Count of total Recd on time PO numbers 12
Now I do the division (Recd on time PO numbers/ total PO numbers ) Again in the Edit formula field SUM( COUNT(PO numbers))/ SUM(COUNT(Recd on time PO numbers)) - This gives incorrect results. output is 12.
12/15 should be .8 but it shows 12.
I am not sure why its not doing the calculation correctly.
Is there any way I can achieve this ?
Thanks
OBI_user* 1.00 => http://gerardnico.com/wiki/dat/obiee/int
-
Is it possible to download iOS 5 from one iMac on two ipads and not get them totally wiped of apps and stuff. We have an iPad each and a communal email address and an iCloud address each. One iPad now is totally screwed up.
Thank you for your reply.
I am somewhat new to iOS and OS having grown up with DOS and Windows. I am not familiar with IMAP and iCloud and I am not even sure which types of servers my various emails use.
The problem I would anticipate with iCloud is that (I assume) it would limit my access to data (including mail) on the iCloud to when I happen to be logged onto the internet. I also assume(?) that large files (photos etc.) would require some time to download whenever I wish to access them from whichever device I happen to be using (I hope I am wrong about this).
I have kept my devices to 500gb - 1TB for OS and 32gb - 128gb for iOS but since I have pretty slow WiFi (shared with DirecTV Whole Home and Netflix streaming) it is my impression that iCloud might be quite limited due to data transfer times.
Perhaps a factor would be that I have 2 DSL lines and my main DSL line is connected to two wireless routers (to also provide WiFi in a metal building that blocks WiFi and Cellular signals)
I may be totally wrong in my assumptions regarding iCloud. My mail is not so urgent that I need access to it instantly and I could wait until I had internet access or I can get it on my iPhone. My main concern with iCloud would be my data files (Word, Pages, Excel, Numbers etc.).
On the other hand, if I wanted to keep my 10,000 emails that would take up a lot of iCloud memory and I don't know how to measure how much storage it would take or how to move Hotmail or even iCloud mail to iCloud.
It may take me some time to figure this out. -
How to get the total execution time from a tkprof file
Hi,
I have a tkprof file. How can I get the total execution time. Going through the file i guess the sum of "Total Waited" would give the total time in the section "Elapsed times include waiting on following events:"
. The sample of tkprof is given below.
SQL ID: gg52tq1ajzy7t Plan Hash: 3406052038
SELECT POSTED_FLAG
FROM
AP_INVOICE_PAYMENTS WHERE CHECK_ID = :B1 UNION ALL SELECT POSTED_FLAG FROM
AP_PAYMENT_HISTORY APH, AP_SYSTEM_PARAMETERS ASP WHERE CHECK_ID = :B1 AND
NVL(APH.ORG_ID, -99) = NVL(ASP.ORG_ID, -99) AND
(NVL(ASP.WHEN_TO_ACCOUNT_PMT, 'ALWAYS') = 'ALWAYS' OR
(NVL(ASP.WHEN_TO_ACCOUNT_PMT, 'ALWAYS') = 'CLEARING ONLY' AND
APH.TRANSACTION_TYPE IN ('PAYMENT CLEARING', 'PAYMENT UNCLEARING')))
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 442 0.08 0.13 0 0 0 0
Fetch 963 0.22 4.72 350 16955 0 521
total 1406 0.31 4.85 350 16955 0 521
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 173 (recursive depth: 1)
Number of plan statistics captured: 1
Rows (1st) Rows (avg) Rows (max) Row Source Operation
1 1 1 UNION-ALL (cr=38 pr=3 pw=0 time=139 us)
1 1 1 TABLE ACCESS BY INDEX ROWID AP_INVOICE_PAYMENTS_ALL (cr=5 pr=0 pw=0 time=124 us cost=6 size=12 card=1)
1 1 1 INDEX RANGE SCAN AP_INVOICE_PAYMENTS_N2 (cr=4 pr=0 pw=0 time=92 us cost=3 size=0 card=70)(object id 27741)
0 0 0 NESTED LOOPS (cr=33 pr=3 pw=0 time=20897 us)
0 0 0 NESTED LOOPS (cr=33 pr=3 pw=0 time=20891 us cost=12 size=41 card=1)
1 1 1 TABLE ACCESS FULL AP_SYSTEM_PARAMETERS_ALL (cr=30 pr=0 pw=0 time=313 us cost=9 size=11 card=1)
0 0 0 INDEX RANGE SCAN AP_PAYMENT_HISTORY_N1 (cr=3 pr=3 pw=0 time=20568 us cost=2 size=0 card=1)(object id 27834)
0 0 0 TABLE ACCESS BY INDEX ROWID AP_PAYMENT_HISTORY_ALL (cr=0 pr=0 pw=0 time=0 us cost=3 size=30 card=1)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file sequential read 350 0.15 4.33
Disk file operations I/O 3 0.00 0.00
latch: shared pool 1 0.17 0.17
********************************************************************************user13019948 wrote:
Hi,
I have a tkprof file. How can I get the total execution time.
call count cpu elapsed disk query current rows
total 1406 0.31 4.85 350 16955 0 521TOTAL ELAPSED TIME is 4.85 seconds from line above -
Is it possible to get the total value for column and assign to other field
hi,
Is it possible to get the total value of particular column and assign that value to another field?
How to do this?
Thanks in advance,
SANAfridi,
My extended controller class code:
package xxhr.oracle.apps.per.selfservice.appraisals.webui;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageStyledTextBean;
import oracle.apps.per.selfservice.appraisals.webui.OverviewPageCO;
import oracle.jbo.Row;
public class XXOverviewPageCO extends OverviewPageCO {
public XXOverviewPageCO() {
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
if(pageContext.getParameter("XXCalcAvgButton")!=null){
throw new OAException("welcome",OAException.INFORMATION);
//getSum(pageContext, webBean);
private String getSum(OAPageContext pageContext, OAWebBean webBean) {
OAApplicationModule am = pageContext.getApplicationModule(webBean);
OAViewObject ratvo = (OAViewObject)am.findViewObject("CompetenceElementsVO");
OAViewObject valuevo = (OAViewObject)am.findViewObject("PerRatingLevelsVO");
Integer Sum = new Integer("0");
int numofRows = ratvo.getRowCount();
for (int x = 0; x < numofRows; x++) {
Object Rating =
ratvo.getRowAtRangeIndex(x).getAttribute("ProficiencyLevelId");
if(Rating!=null) {
int numofRowsforvalue = valuevo.getRowCount();
for(int i=0;i<numofRowsforvalue;i++){
if(valuevo.getRowAtRangeIndex(i).getAttribute("RatingLevelId").equals(Rating)){
Object StepValue=valuevo.getRowAtRangeIndex(i).getAttribute("StepValue");
Sum = new Integer(StepValue.toString()) + Sum;
OAMessageStyledTextBean displayCompAvg=(OAMessageStyledTextBean)webBean.findChildRecursive("XXCompAvgText");
displayCompAvg.setValue(pageContext,Sum);
return null;
But it is not affecting in the page.
Can you please tell me what is the problem. -
Deletion of Total(Aggregated Sum) rows in planning book
I want to get rid of 'Total(Aggregated Sum)' rows in planning book tables.
'Total' line is useful but too many lines are uncomfortable for planners, so we're searching for the method not to use it.
If you know how to configure or use macro for it, please let me know.
Thank you,
HyeReeHi,
I can delete totals, but I can´t delete subtotals.
Macro Delete Totals
IF
New condition
PLOBS_FOR_LEVEL( ACT_LEVEL ) = 1
Step 1 iterations
ROW Ratio 1
ROW_VISIBLE( 0 )
ROW Ratio 2
ROW_VISIBLE( 0 )
ROW Ratio n
ROW_VISIBLE( 0 )
ENDIF
This macros works ok to deleting row totals.
Raúl. -
How to create a overall total or sum for structures created?
Dear all expert,
I have a BW query as below.
Rows:
Structures
- Product A
- Product B
- Product C
- Product D
Diameter
Description
Columns:
Storage Location
Key Figures:
- Total Quantity
- Daily Quantity
How can I obtain the total or sum at the rows for all the structures?
Thank You.Create a formula in the structure as sum of all the elements of the structure. It is not clean and you won't get just a total row below the list of elements of the structure, but that is the best option with structures and characterisitics mixed in the rows.
Thanks
Vineet -
DLookUp Referencing a Query To Get a Total Amount Owed
I have a form named: Branch 142 Membership that has a text box named: TextBoxTotalAmountDueToDate. The control source is: =DLookUp("[Total Amount Due]","[QryTotalAmtDueBy]","[MemberID]=" & [Forms]![Branch 142 Membership]![MemberID])
I'm getting the sum total for all of the records in my database that is the sum for just one member. There's one payment record in the Payments table. Of course when I open the query I get the total for the one payment record.
I want to get the Sum([PPUnionDuesAmountNoDeduct]-[PaymentAmount]) for each record in the object: TextBoxTotalAmountDueToDate. If the amount is zero I want the text box to display zero. When I entered =Sum([PPUnionDuesAmountNoDeduct]-[PaymentAmount])
I got an error in text box.
Thanks for the help.I will try again. For example, I have a table (Payments) that has 5 records. The 5 Payments table records has $24.45 entered all for the same person, Billy Bob that totals $122.25. I have a table (Members) that Billy Bob is one of 10 records. The query:QryTotalAmtDueBy
returns 1 result (record) and it is only for Billy Bob for $122.25 because he is the only one entered in the Payments table. Total Amount Due: Sum([PaymentAmount]-[PPUnionDuesAmountNoDeduct])
When I enter into the control source for text box:
TextBoxTotalAmountDueToDateTab5 the expression: =DLookUp("[Total Amount Due]","[QryTotalAmtDueBy]","[MemberID]=" & [Forms]![Branch 142 Membership]![MemberID]) on the form: Branch 142 Membership. I get the
$122.25 total amount due for Billy Bob and for the remaining 9 records in the
TextBoxTotalAmountDueToDateTab5.
You suggested I try =DLookUp("Total Amount Due","QryTotalAmtDueBy"). I get #Error when I entered it in the text box:
TextBoxTotalAmountDueToDateTab5. I modified what you gave me and entered: =DLookUp("[Total Amount Due]","[QryIndivTotalAmtDueBy]"). I still get the
$122.25 total amount due for Billy Bob and for the remaining 9 records in the Members table.
I don’t care if I use a control source that references the
Total Amount Due from the query QryTotalAmtDueBy or if I use a control source expression that is the sum
of the PaymentAmounts minus the sum of the PPUnionDuesAmountNoDeduct for each record in the Members table. I've tried:
=IIf(IsNull([MemberID]),0,DSum("[PPUnionDuesAmountNoDeduct]-[PaymentAmount]","Payments","[MemberID]=" & [MemberID])). I get nothing for
any record in the Members table. -
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 -
I have a report spec. for which I have to write a SQL query which should print the total aggregate at the top.
For ex. For Dept 10 which has salaries 1000,2000,3000
Deptno Salary
10 Total of Sal for dept 10
1000
2000
3000
20 Total of Sal for Dept 20
Total Final Total (individual grouping totals)
Please suggest the SQL for getting individual totals at the top
Regards,
Gaurav Srivastavaselect decode(grouping(empno), 1, decode(grouping(deptno), 1, 'TOTAL', to_char(deptno))) DEPT, sum(sal) sal
from emp
group by grouping sets ((deptno, empno),(deptno), ())
order by emp.deptno, grouping(emp.empno) desc;
DEPT SAL
10 8750
2450
5000
1300
20 10875
800
2975
3000
1100
3000
30 9400
950
1600
1250
1250
2850
1500
TOTAL 29025 -
How can I get the total "values" in a hashtable ?
i know that i can get the total values in a hashtable by hash.elements() method. It returns an
enumeration with all the values present in this hashtable. this is fine upto here.
Now the preoblem is:
According to what rule this enumeration will be returned. I mean..
If i added in key A with value a,
then key B with value b;
then key C with value c;
then key D with value d;
(They all are objects of type String)
now i call ... hash.elements(); Suppose it returns Enumeration enum;.
Now in what order they all are present in this hashtable.
Meaning is that if i move arond this enum in what sequence they all will be returned.
option A ) In the same order as they were inserted in hashtable.
option B ) According to LIFO;
option C) There is no fix rules , simply it return all the elements and u cannot judge that the first element in enum was really the first element inserted in the hashtable and the second element of enum was really the second element inserted in the hashtable.
What do u think..which option is correct ?
Ny idea will highly appreciated.
Thanks in advance.
Sanjeev Dhimanhi, i am again..
boss ! this is not true..u just change the order and or change the keys and something like ...
"Sanjeev", "hello"
"Dhiman", "hi"
"Technosys" ,"Services"
u will find that its not LIFO..really i was thinking before coding my project that option A is correct and with knowledge i wrote 3 - 4 classes but when i run the programm its starts throwing errors.
so, i posted this question. I think "apppu" is right.
I think , firstly hash is calculated for each value and that value is returned which can be received in a fastest way and hence not necessarily in LIFO and FIFO..
Thanks to u also as u gave ur precious time for me.
Once again.
Thank you very much.
Sanjeev Dhiman -
File Duration Question: Any Way to Get Quick Totals?
Another curious-if-there's-a-way-to-do-this question:
I notice that Media Manager (for which I've now added a custom key command) will tell me the combined media file size for any group of clips I select in the FCP7 Browser (whether an entire Bin's worth, or even a non-contigous selection of specific clips therein). For individual clips of course I need only look at the Browser's "Size" column.
Is there an equivalent way to do this vis-a-vis the total duration of a given group of clips -- again, whether an entire Bin's worth, or just a group of individually selected ones? The Browser has its Duration column with running time info for each separate clip, but is there any quick way to get the total, combined running time for a group of multiple clips?
(An example would be wanting to quickly check how many hours/minutes of material was shot in a given setting, or on particular day, etc., without having to manually add up the Duration info for dozens of separate clips.)
Any suggestions appreciated.
Thanks,
John B.
TorontoWhile still hoping for a fewer-clicks, Browser-only solution, I have to admit that would indeed provide the desired information.
Thanks for the reply!
jb -
How To Get The Total Delivered Quantity of a Sales Order
Hello All,
I have a requirement of getting the total delivery quantity of the sales order .I have checked it in LIps table but I am getting partially delivered quantity for a schedule line item.Can any one tell me how to get the total delivered quantity.
Regards,
Pavani.Hi
Check the Table:
VBEP - Sales Document: Schedule Line Data.
Inside the table check the Quantity Fields.
Regards,
Sreeram
Maybe you are looking for
-
I used to be able to display pdf documents using Adobe Reader instead of Firefox's built in. I have tried everything that you suggest and that Adobe suggest. I have uninstalled and reinstalled Firefox. I have uninstalled and reinstalled Adobe Reader
-
Calculation of memory allocation
Hi all, I am working as system administrator, i want to know how much memory is allocated to oracle(8i) in my system. db_block_buffers = 51200 shared_pool_size = 314572800 large_pool_size = 61400 log_buffer = 3145728 Can enybody tell above sizes in M
-
Is there a download for lightroom2.7 that will allow it to use camera raw for a Canon T3i raw files?
-
I need to create Arabic and Farsi brochures in InDesign CS6. Does anyone know where I can get a plug-in to make Middle Eastern languages work correctly from right to left?
-
Quicktime player 10.1 doesn't read film .mov
quicktime player 10.1 doesn't read film .mov . for information I used 10.0 version before and it worked well. OS 10.7.5 doesn't accept previous quicktime player version. What can I do