How to total sum of all low bid
CALCBTOT CALL LETTING VENDOR
70,526 001 97101502 M018
63,960 001 97101502 S201
72,289 001 97101502 S498
21,100 001 97102401 A620
19,129 001 97102401 B0020
36,000 001 97102401 H330
26,424 001 97102401 J0008
3,328,419 002 97102401 C470
3,426,462 002 97102401 C480
3,495,741 002 97102401 E110
0 003 97102401 M577
465,280 003 97102401 R0026
1,359,124 004 97102401 E130
1,365,660 004 97102401 P272
I would like sum the low bid from the above table. for example call 001 has 7 vendors submitted their bid. I just want to get the low bid out of the 7 vendors and add with the low bid with call number 002, 003 and 004. can you shed some light how I can do this.
thank youEdited by: 893601 on Nov 15, 2011 12:56 PM
I did a running total kind of thing but I got the result is the same as Solomon.
/* Formatted on 11/15/2011 4:16:42 PM (QP5 v5.149.1003.31008) */
WITH sample_data AS (SELECT 70526 CALCBTOT,
001 CALL,
97101502 LETTING,
'M018' VENDOR
FROM DUAL
UNION ALL
SELECT 63960,
001,
97101502,
'S201'
FROM DUAL
UNION ALL
SELECT 72289,
001,
97101502,
'S498'
FROM DUAL
UNION ALL
SELECT 21100,
001,
97102401,
'A620'
FROM DUAL
UNION ALL
SELECT 19129,
001,
97102401,
'B0020'
FROM DUAL
UNION ALL
SELECT 36000,
001,
97102401,
'H330'
FROM DUAL
UNION ALL
SELECT 26424,
001,
97102401,
'J0008'
FROM DUAL
UNION ALL
SELECT 3328419,
002,
97102401,
'C470'
FROM DUAL
UNION ALL
SELECT 3426462,
002,
97102401,
'C480'
FROM DUAL
UNION ALL
SELECT 3495741,
002,
97102401,
'E110'
FROM DUAL
UNION ALL
SELECT 0,
003,
97102401,
'M577'
FROM DUAL
UNION ALL
SELECT 465280,
003,
97102401,
'R0026'
FROM DUAL
UNION ALL
SELECT 1359124,
004,
97102401,
'E130'
FROM DUAL
UNION ALL
SELECT 1365660,
004,
97102401,
'P272'
FROM DUAL)
SELECT TO_CHAR (low_bid, '$999,999,999') low_bid,
TO_CHAR (call, '009') call,
TO_CHAR (SUM (low_bid) OVER (ORDER BY call), '$999,999,999')
running_total
FROM ( SELECT MIN (CALCBTOT) low_bid, call
FROM sample_data
GROUP BY call)
ORDER BY call
LOW_BID CALL RUNNING_TOTAL
$19,129 001 $19,129
$3,328,419 002 $3,347,548
$0 003 $3,347,548
$1,359,124 004 $4,706,672
Similar Messages
-
Hi All.
I have Requirement to Calculate the Total Duration in OAF Table Style Region.
Check In
Check Out
Total Hours (HH:MM)
08:50:59
15:29:56
6:38
07::02:18
17:05:10
10:02
08:20:56
16:28:33
8:07
Total
24:47
If i Could not Able to Sum of 6:38+10:02+8:07=24:47 Due to VArchar2 as Display.
If i use Total (True) in Attribute it is through as sum 0.
Please Help me to Calculate the Duration Sum in OAF Page.
Regards
RamaYour question is not clear..
Provide CREATE tABLE and INSERT statements and expected output. Your DB version also.
What is the data type of the column RUNTIME?
And what does your calculation " avg((01:29:40+ 07:10:58)/14)" mean - what is the result of this?
Please read FAQ: {message:id=9360002} -
Totals column that is the sum of all the data columns
In a Report, I have several data columns, and then I want a totals column that is the sum of all the data columns. So for every row, the totals column will show the total of the data columns. How do I do this?
Thanks, WayneOne way, create CF_total:
function CF_totalFormula return Number is
n number;
begin
select sum(coll) + sum(nvl(col2, 0)) + sum(col3)..... into n
from tbl;
return n;
exception
when others then
return null;
end;
Another way, if you have SUMCOL1, SUMCOL2, ....:
function CF_totalFormula return Number is
begin
return :SUMCOL1 + SUMCOL2 +.....;
end -
How can I sum all the amount per line?
HI,
How can I sum all the amount per line?
EXAMPLE:
[code]
TOTAL:
1,000 2,000 5,200 $8,200
400 1,200 6,000 7,600
[/code]
THANKS!!If you are sure of the number of columns that you are gonna get then you can add them to a variable and display.
total = itab-col1 + itab-col2 + itab-col3.
If you dunno how many columns will come , you have to use field symbols.
Say the datatabse table has 16 columns which will contain your price and you have to calculate the sum of all those , then assign them to field symbols and calculate.
Have a look at the following code.
FORM GET_VALUES_FROM_COSS .
FIELD-SYMBOLS: <FS1> TYPE ANY.
DATA: V_COMPONENT1 TYPE I.
V_COMPONENT1=31. " your field of table from which amount field starts
Cumulate the posting values of all the 16 period buckets as to get
total production order cost. This is to handle the partial posting of
production order values in different periods.
DO 16 TIMES.
ADD 1 TO: V_COMPONENT1.
ASSIGN COMPONENT V_COMPONENT1 OF STRUCTURE COSS TO <FS1>.
IF COSS-WRTTP EQ '05' AND COSS-KSTAR EQ C_KSTAR1.
ADD <FS1> TO I_FINAL-PL_LABCOST.
ELSEIF COSS-WRTTP EQ '04' AND COSS-KSTAR EQ C_KSTAR1.
ADD <FS1> TO I_FINAL-ACT_LABCOST.
ELSEIF COSS-WRTTP EQ '05' AND COSS-KSTAR EQ C_KSTAR2.
ADD <FS1> TO I_FINAL-PL_MATCOST.
ELSEIF COSS-WRTTP EQ '04' AND COSS-KSTAR EQ C_KSTAR2.
ADD <FS1> TO I_FINAL-ACT_MATCOST.
ELSEIF COSS-WRTTP EQ '05' AND COSS-KSTAR EQ C_KSTAR3.
ADD <FS1> TO I_FINAL-PL_OPCOST.
ELSEIF COSS-WRTTP EQ '04' AND COSS-KSTAR EQ C_KSTAR3.
ADD <FS1> TO I_FINAL-ACT_OPCOST.
ELSEIF COSS-WRTTP EQ '05' AND COSS-KSTAR EQ C_KSTAR4.
ADD <FS1> TO I_FINAL-PL_FACCOST.
ELSEIF COSS-WRTTP EQ '04' AND COSS-KSTAR EQ C_KSTAR4.
ADD <FS1> TO I_FINAL-ACT_FACCOST.
ELSEIF COSS-WRTTP EQ '05' AND COSS-KSTAR EQ C_KSTAR5.
ADD <FS1> TO I_FINAL-PL_LABCOST.
ELSEIF COSS-WRTTP EQ '04' AND COSS-KSTAR EQ C_KSTAR5.
ADD <FS1> TO I_FINAL-ACT_LABCOST.
ELSEIF COSS-WRTTP EQ '05'.
ADD <FS1> TO I_FINAL-OTHER_PL_COST.
ELSEIF COSS-WRTTP EQ '04'.
ADD <FS1> TO I_FINAL-OTHER_ACT_COST.
ENDIF.
ENDDO.
ENDFORM. " GET_VALUES_FROM_COSS
Let us know if u need more inputs -
I really would like to know how to totally remove Yahoo toolbar from my Firefox browser as well as my computer. I don't like special toolbars at all. I find it irritating that you included one in the newest version of your browser. In the future I would hope you would leave this or any other out. Firefox used to be my favorite browser to use, now I am not going to want to use it because of the extra toolbar. Please tell me there is a way to remove this, not just hide it.
You can't move the Yahoo Toolbar from IE to Firefox, they are totally different "behind the scenes". However you can install it, [http://us.toolbar.yahoo.com/ http://us.toolbar.yahoo.com/] and I believe if you log in with your Yahoo account it will sync your data.
-
I have a dynamic table that calculates the sum of all rows, no issue. I'm struggling with pulling out a subtotal though. I would like to have a check box in each row that flags those rows and gives the sum of their total. Any help would be greatly appreciated.
Here's something I threw together rq. The script is in the change event for the checkbox in the table. (Of course, you'll have to modify it to suit the names of your fields.)
var rows = xfa.resolveNodes("tblAmounts.Row1[*]");
var subtotal=0;
for (i=0; i<rows.length; i++) if (rows.item(i).cbAdd.rawValue == 1) subtotal = subtotal + rows.item(i).nfAmount.rawValue;
nfSubtotal.rawVlaue=subtotal; -
How to get total sum of big filtered table?
Hello
I'm using JDeveloper 11.1.1.3.0
I have an af:table with big data source (100 000 rows). The table have filters.
I want to display total count of the filtered rows and total sum by the one of column of the filtered rows in the footer of the table.
In my backing bean I can get a Map with all filter values:
Map<String, Object> filters = ((FilterableQueryDescriptor)table.getFilterModel()).getFilterCriteria();And, in this case, I may create the method for getting sum I need on my own.
In this method I may create SQL Query dynamically, because I have to process all filter values with different types
It is possible, but, maybe, there is a more easy way to do it?
AnatoliiHi, sanchezis
Code example.
In the jsp:
<af:column sortProperty="Sumv" sortable="true" filterable="false" align="end" width="125px"
headerText="#{bindings.TransactionView1.hints.Sumv.label}" id="c16">
<af:outputText value="#{row.Sumv}" id="qt4">
<af:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
</af:outputText>
<f:facet name="footer">
<af:panelGroupLayout id="pg41" halign="right"
layout="vertical">
<af:outputText value="#{backing_reptransactions.tableTransactionTotalSumV}" id="ot44">
<af:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
</af:outputText>
</af:panelGroupLayout>
</f:facet>
</af:column>In the backing bean:
public double getTableTransactionTotalSumV() {
DCIteratorBinding iter =
binding.findIteratorBinding("TransactionView1Iterator");
TransactionViewImpl vo = (TransactionViewImpl)iter.getViewObject();
return vo.getFilteredTotalSumV();
}In the ViewImpl (TransactionViewImpl) class.
public double getFilteredTotalSumV() {
double sumV = 0d;
DBTransaction dbTransaction = getDBTransaction();
ResultSet rs = null;
String query = "SELECT SUM(SumV) sumvtotal FROM (" + getQuery() + ")";
String str1 = "WHERE ROWNUM < :Bind_RangePage_High";
String str2 = "WHERE Z_R_N > :Bind_RangePage_Low";
int i = query.indexOf(str1);
if (i > 0) {
query = query.substring(0, i) + " " + query.substring(i + str1.length());
i = query.indexOf(str2);
if (i > 0) {
query = query.substring(0, i) + " " + query.substring(i + str2.length());
PreparedStatement st = dbTransaction.createPreparedStatement(query, 0);
try {
Object[] params = this.getWhereClauseParams();
int index = 0;
for (Object avalue : params) {
String key = (String)((Object[])avalue)[0];
if ((!key.equals("Bind_RangePage_High")) &&
(!key.equals("Bind_RangePage_Low"))) {
Object value = ((Object[])avalue)[1];
index++;
if (value instanceof Integer) {
st.setInt(index, (Integer)value);
} else if (value instanceof oracle.jbo.domain.Date) {
st.setDate(index,
((oracle.jbo.domain.Date)value).dateValue());
} else if (value instanceof java.sql.Date) {
st.setDate(index, (Date)value);
} else {
st.setString(index, (String)value);
rs = st.executeQuery();
if (rs.next()) {
sumV = rs.getDouble("sumvtotal");
} catch (SQLException e) {
throw new JboException(e);
} finally {
if (st != null) {
try {
st.close();
} catch (SQLException e) {
return sumV;
public long getFilteredTotalCount() {
return this.getEstimatedRowCount();
}But, you need to know that in the TransactionView in the "General" - "Tuning" I set up next values:
"All rows",
"As needed",
"Fill Last Page of Rows when Paging through Rowset",
"Passivate State(..."
Access Mode - "Range Paging Incremental"
Range Size - 160
Range Paging Cache Factor - 3
If you have other values, then your SQL request may be different, so, you will have to rewrite it.
I talk about
"WHERE ROWNUM < :Bind_RangePage_High",
"WHERE Z_R_N > :Bind_RangePage_Low",
if ((!key.equals("Bind_RangePage_High")) &&
(!key.equals("Bind_RangePage_Low")))If you have other solution, please, tell me.
Anatolii -
How do I find the total size of all my Music in iTunes 11?
I'm looking to get a new iPod, either a nano or Touch, so I'm trying to find the total size of all of my Music. Since iTunes 11's interface is so different from previous versions, I don't see a way to view that.
Ctrl B to show top menu
View Show Status Bar to show the grey bar at the bottom with the info you want.
While your there View> Show Sidebar and see if you prefer that. -
How to Hide rows in ALV without affecting total sum at the end of table?
Hi,
I need some help in hiding particular rows in an ALV Grid without affecting the total sum at the end of the table. I am trying to hide the rows that have negative quantities, but I still need those values so that the user can still compute for the total sums. Can anyone help? Thanks.
JosephHi,
Hopw this way you can hide the rows in the GRID.
DATA:
ld_column TYPE lvc_fname,
ld_hide TYPE abap_bool.
FIELD-SYMBOLS:
<ls_entry> TYPE any,
<ld_fld> TYPE any.
ld_column = 'COL_1'. " column which you want to suppress if everything is zero
ld_hide = abap_true. " = 'X'; default hide column
LOOP at <gt_outtab> ASSIGNING <ls_entry>.
ASSIGN COMPONENT (ld_column) OF STRUCTURE <ls_entry> TO <ld_fld>.
IF ( <ld_fld> > 0 ).
ld_hide = abap_false. " display column because at least single value > 0
EXIT. " leave LOOP
ENDIF.
ENDLOOP.
READ TABLE gt_fcat INTO ls_fcat
WITH KEY fieldname = ld_column.
IF ( syst-subrc = 0 ).
ls_fcat-no_out = ld_hide.
MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
ENDIF.
hop you will get the total with for those columns too.
Regards,
Madhavi -
How to get last row and sum of all columns in one query
Hi ,
is there a way to get last record for a column and sum of all record for another column in the same query.
Best Regards ,You should define your requirements properly for volunteers to help here..
Your data is not good enough to provide you accurate solution. Reason being you dont have a proper column which differentiates between first and last entry.
The solution becomes easy based on your desgin.
I have introduced a grouping column called "id" and a time column called "time_of_insert" (only this way you can confidently say that you can differentiate between first and last (also a fool proof solution) --- you may optionally use sequence(instead of date though if you say you may end up inserting two rows at the same time, then probably sequence would be a better choice to differentiate rather than a timestamp field) etc...)
With your sample data something like this can be done to achieve your desired result.
WITH dataset AS
(SELECT 1 id,10 used, 8 remain,systimestamp+1/24 time_of_insert FROM DUAL
UNION ALL
SELECT 1 id, 1, 7,systimestamp+2/24 FROM DUAL
UNION ALL
SELECT 1 id,2, 5,systimestamp+3/24 FROM DUAL
UNION ALL
SELECT 1 id,1, 0,systimestamp+4/24 FROM DUAL
UNION ALL
SELECT 1 id,0, 0,systimestamp+5/24 FROM DUAL
UNION ALL
SELECT 1 id,1, 4,systimestamp+6/24 FROM DUAL)
SELECT *
FROM (SELECT SUM (used) OVER () sum_all,
FIRST_VALUE (remain)
OVER (PARTITION BY id ORDER BY time_of_insert DESC)
last_row
FROM dataset)
WHERE ROWNUM = 1;
Output:
SUM_ALL LAST_ROW
15 4
Cheers,
Manik. -
Hi All,
The following is a test I performed in order to check a problem I got.
I created a simple function in Oracle which receives a number and returns it divided by 2. (NUM/2). I registered this function in Discoverer Administrator and then created a simple report with only one column: A calculated column, calling for this formula with the value of 1000. As expected, the returned value was 500. But when I tried to use Total->Sum of this column, it failed. All the other options (Average, Count...) worked, except the sum.
As I mentioned in the beginning, this is just a test for my real situation.
Any ideas how it can be solved?Hi
Other than the neat workaround suggested by Russ, if my memory serves me right that issue was fixed in the final release for 4.1 - 4.1.48
The patch to upgrade Discoverer 4.1 Admin and Desktop is 3201601, while for Plus and Viewer the patch is 3201610. These patches will upgrade you to 4.1.48.06. If you are using E-Business Suite the patch you need is 3451636 which is the upgrade to 4.1.48.08.
All of these patches are still available for download on Metalink.
For further information on the latest patches please look on my blog here: http://learndiscoverer.blogspot.com/2006/09/releases-and-patch-numbers-september.html
I'll be updating this again very soon with the latest information for other releases but for 4.1 my posting is accurate.
Best wishes
Michael -
How to get Sum for my Elapse Time string for my group
Hi,
How can I get the sum of an elapse time string in my group footer 2 and group footer 1 from the report screenshot attached.
I have a report that display TimeIn and TimeOut of an employee.
For the total time I have created a formula that will take my time in seconds and displaying it in hrs, minutes and seconds.
How can I get the sum of all the total time per day and display this in my group footer 2.
As well I will need to add the grand total to group footer 1 for the total of days.
The formula I have for the total time is as follow:
WhileReadingRecords;
NumberVar TotalSec := {TimeLogs.TotalTime};
NumberVar Hours := Truncate (Remainder ( TotalSec , 86400) / 3600) ;
NumberVar Minutes := Truncate (Remainder ( TotalSec , 3600) / 60) ;
NumberVar Seconds := Remainder (TotalSec , 60) ;
Totext ( Hours , '00' ) + ':' +
Totext ( Minutes , '00' ) + ':' +
Totext ( Seconds , '00' )
This is a seperate question below but related as well to this report.
Another question I have is how can I round up for example 03:30:58 to 03:31:00
And also how can I round down for example 03:26:10 to 03:26:00
Any help would be appreciated.
Thank you,
JoeHi Jamie,
Well I ran into an issue with this. My Daily Total, there is no issue, it is displaying the proper time. But when I add a summary to my Group Footer 1, it doesn't add up properly.
If I select only 1, 2, or 3 days my Date Range Total is adding fine but when selecting 5 days for example, as you can see from the picture below, for an unknowned reason the total of hrs is wrong.
Do you know why this is happening.
Than you for your help.
Joe
Picture below, this is working fine? -
How do you sum columns in same view
I have a search component (drag and drop the viewCriteria) with a table.
In the table is a column for an amount (number). I need to sum the amount and put it in the footer.
I have done this many times with master/detail. Lots of info on that on the web as well. Really simple.
In the view:
So I create a transient attribute (sumAmount).
I set the value to Expression and use one of the following (and several others that are not here).
On the screen:
drag SumAmount from the DC onto the footer. (OutputText no label)
OK so far!?
Run and query - (wishful thinking)
Change the query and new totals appear (not that far yet).
I have tried several permutations.
adf.object.sum("Amount")
sum("Amount")
adf.object.ViewVO.getrowset.sum("Amount")
All show absolutely nothing - I have the output text defined in the footer and the footer is displaying fine.
The table also has some dates in the criteria - when I generate the rowImpl - the search panel is rendered useless due to the Date Domain vs Sql Date ( I know how to manage this)
This has to be simple - just need to get a bit of help on it.
I have tried to do this similar to the master/detail (but in this case - no detail). Still no value.
I should be able to create a "formula" column without the use of java rowImpl.Finally - I have all the pieces - they are (were) as follows.
1) create the View Object.
2) add the summary column (transient) (be sure to get the data type correct (Number or BigDecimal)).
3) create the view object implementation. (the Java tab in the view object - first box)
4) create the view row implementation and expose the accessors. (the Java tab in the view object - second box).
5) use Steve Muench's help to do the summation - it is a bit tricky and it has a depreciated call in it - but it works. (it is easy to modify to fit - just get the right attribute name for the sum & data type - I used Big Decimal)
http://otn.oracle.com/products/jdev/tips/muench/recalctotalvo/RecalcTotalOfRowsInVO.zip (may have to look for the proper link - I found a lot of broken references)
6) add a footer to the table in the search page and drag and output text box into it (all one step with drag and drop) - leave it empty.
7) in the bindings page of the screen - add an attribute binding for the summary column from the Application Module.
8) once the binding is made, go back to the output text box and use the inspector to create an expression and bind the value to "adf bindings" - data - and select the view-backing definition from the binding you just created.
9) if you want to format this to right justified - surround with JSF HTML "panel grid - 1 column width=100% and style= text:align right - I usually do bold as well.
10) sit back, relax and run - it should work. -
Displaying a total sum value in the af:table - footer
Hello everyone,
I have seen various threads on how to calculate a summary column based on a af:column in an af:table. I would like the value of this column to be displayed in the af:table -> footer (right undernead the af:column)
I'm having trouble putting together the pieces. This is the last requirement I have on this page, so hopefully I won't have to start all over.
Here this what I have:
I have created my page. (jspx) I did not create the page with a "backing bean". I have seen in various threads that the backing bean can be used to programmatically populate the table.
This is what I have done so far.
For the DataModel:
I have created my entity object, and I have a view assigned to the object. I assigned the view to my Application Module.
For the UserInterface:
On the layout, I dragged the instance of the view from the page definition. I created an af:table.
My questions/train of thought are:
I didn't create a "backing bean" when I first created my jspx page. From the various threads that I have seen, they all reference this. Can anyone explain how I can do this when the page has already been created? I'm using jdev version 10.1.3.3
Within the backing bean, I assume this is where I would then create a method that would do the "sum" of my column.
To display the column:
I would then create an af:output_text and drag it to theh table footer. The binding section
If anyone has a prior thread that I haven't found that can point me in the right direction with what I already I would really appreciate it.
ThanksKuba,
By creating a managed bean against the page definition, you are able to access the "iterator". The iterator is an object that is based off of hte View object (which the page is build off of)... From there, you can then loop through the rows and add them together to come up with the total sum.
You can then reference this method in the TEST.java class since it was created as a managed bean.
I believe I got the gist of it now... Coming from an Oracle Forms perspecitive, it is actually pretty similar. Now I understand what Managed Beans are used for. Thanks again for the great example.
Danny -
How should i increase over all buffer hit ratio.....
Hi all,
As shown below if my DB2 databse buffer Qulaity is low .. How should i increase over all buffer hit ratio..
Please advice on any sap standrd notes or procedures
Number 1
Total Size 80,000 KB
Physical Reads 6.65 ms
Physical Writes 0.00 ms
Overall Buffer Quality 86.05 %
Data Hit Ratio 85.79 %
Index Hit Ratio 87.50 %
No Victim Buffers 259,079,295
--rahulOne of the options is to simply increase the bufferpool size using the following command
db2 alter bufferpool immediate <bufferpool name> size <new bufferpool size>
However, this will affect the hit ration for a particular bufferpool. If you have more than one bufferpool, you need to identify the bufferpool(s) with worst hit ratio. In the SAP DBA Cockpit, check using
Performance -> Bufferpool
The victim buffer information is only useful in case you use alternate page cleaning.
Note that there are other options to fight bad bufferpool hit ratio - however, with your small bufferpool size (80MB) maybe increasing the size is the appropriate step.
Malte
Maybe you are looking for
-
Not able to create table in analysis services data source
Hi All, I am creating a cube with Enterprise edition template when I try to generate the schema I am getting below error. All the services are in started state. Kindly help us to rectify
-
Since upgrade I can no longer see tray icons on bottom of screen - how do I uncover them?
Since the latest upgrade, Firefox now covers my entire screen. I can get used to the disappearing tabs & such on the top, but for my job I need to switch back & forth between browser and email a lot, and need quick control of the volume bar. The enti
-
Since downloading iOS 7, I have been having trouble purchasing music from iTunes Store. When ever I try to make a purchase I always get the message "Your account is not valid in the US store" As I am new at this I don't know what I can do to remo
-
IP address constantly changes requiring adding new port to enable wireless printing
I have a HP Photosmart C7280 printer setup with wireless option. My home network uses a wireless Linksys router. My problem is that the IP address constantly changes, so when trying to print from the desktop in the other room, I have to go through
-
SAPGUI for Java Support on Mac 10.4
Hi, I am using Mac OS 10.4 Tiger version with SAP GUI 6.4 rev6. when I use SAPGUI 6.4 for eCATT Scripts, I am not able to append or insert new rows in the Parameter list. Although, all the commands/pushbuttons are working as they should. On pressing