Sum of the two columns
Hello.I use jdev 11.1.5
= > I had created a Vo in the adf with the table named GrlJrl
I need the sum of the two columns
My scenario
Da Ca
500 100
600 100
100 200
S 400 1200 (adding two field must be displayed in the user interface).
someone help me reach this goal
chk this
Calculate the sum involved new VO
Tags: Java
Similar Questions
-
calculate the sum of the two columns - display the result in the third column
Hello
I have a report and I want to calculate the sum of the two columns of the report and display the total in the third column.
For example: Sample_My_Report
Col1 Col2 (Col1 and Col2) Total
3-7-10
can someone help me with this question.
Thank you.Hello:
If your report is an IR you can use the menu "Tool" to add columns calculated at the State
CITY
-
Combine the two columns of text
I have two columns of text (say that name is a column and the name is the other)
I would like to combine the two columns for the text of these two columns are in a column. (First name and last name in the same column)
Is this possible? If so is there a tutorial somewhere?
Hi Danielle,
The & (concatenation operator) is your friend.
Formula in D2 (fill down)
"B2 &" "& C2.
& joins elements into a single string.
"" inserts a space.
Kind regards
Ian.
-
using outer joins if the two column is null? Use only (+)
Hi all
create the table xxc_tr_num (tl_number number, tr_no number tl_no_id);
insert into xxc_tr_num values (123,100,222);
insert into xxc_tr_num values (124,100,333);
create the table xxc_od_tab (tl_number number, tl_id number);
insert into xxc_od_tab values (123,001);
insert into xxc_od_tab values (null, null);
create table xxc_oth_tab (name varchar2 (10), number of tl_id);
insert into xxc_oth_tab values('abc',,001);
insert into xxc_oth_tab values (null, null);
Wait it out put
tr_no tl_no_id name
100 222 abc
100 333
using outer joins if the two column is null? use only please of outer joins
And I tried to use outer joins on both tl_id column but not get values and I use have County (tr_no ) > 1
Rajesh123 wrote:
Thank you Kiss it is not possible to use having clause?
You need to understand the functioning of the group. If you will not be asked this question.
Check this box
SQL> select tr_no, 2 tl_no_id, 3 count(*) 4 from xxc_tr_num a, 5 xxc_od_tab b, 6 xxc_oth_tab c 7 where a.tl_number = b.tl_number(+) 8 and b.tl_id = c.tl_id(+) 9 group 10 by tr_no 11 , tl_no_id; TR_NO TL_NO_ID COUNT(*) ---------- ---------- ---------- 100 333 1 100 222 1
See what returns the count? You have grouped according to TR_NO and TL_NO_ID. You must take into consideration the TL_NO_ID just put COUNT (TR_NO) does not increase the NUMBER of the whole group. To get the NUMBER on the whole group, I used the analytical function and did. Like this, see the number of the analytical function here
SQL> select tr_no, 2 tl_no_id, 3 count(*), 4 count(*) over(partition by tr_no) 5 from xxc_tr_num a, 6 xxc_od_tab b, 7 xxc_oth_tab c 8 where a.tl_number = b.tl_number(+) 9 and b.tl_id = c.tl_id(+) 10 group 11 by tr_no 12 , tl_no_id; TR_NO TL_NO_ID COUNT(*) COUNT(*)OVER(PARTITIONBYTR_NO) ---------- ---------- ---------- ------------------------------ 100 222 1 2 100 333 1 2
So to answer your question, yes you can't do in the HAVING clause...
-
find the cumulative sum of the previous columns
Hello
How can I get the cumulative sum of a particular column in the preceding lines in the current line.
e.g. I have a table produced,
Date | Orders
__________________
1 JANUARY 10 | 3
JANUARY 2, 10. 5
JANUARY 3, 10. 1
I want to select the date and orders between the 1st and the 3rd. Something like...
Select the Date, the orders for products where Date between to_date('1-JAN-10') and to_date('3-JAN-10')
But I want the output like this...
Date | Orders
__________________
1 JANUARY 10 | 0
JANUARY 2, 10. 3
JANUARY 3, 10. 8
Similarly, when I select it between 2 and 3, I want the output voltage...
Date | Orders
_________________
JANUARY 2, 10. 3
JANUARY 3, 10. 8
and so on. In the output, orders here are the cumulative sum of the previous columns.
Published by: eric clapton, November 8, 2010 20:45Hello
Use the analytical SUM function.
You want to filter by date after the cumulative SUM is calculated, so calculate the SUM in a subquery, then filter by date no later than:WITH got_cm_orders AS ( SELECT dt , orders , SUM (orders) OVER (ORDER BY dt) - orders AS cm_orders FROM products ) SELECT dt , orders WHERE dt BETWEEN DATE '2010-01-02' AND DATE '2010-01-03' ;
-
Comparing the sum of the two tables and correct by difference of amount in its second t
Hello guys,.
I have a very difficult task that I can't get my head around.
The sample data looks like this:
Master table
Request - booking - debit - credit - MasterAmout
1------------1----------------D---------------------------------15.3
1------------2----------------D---------------------------------480.6
1------------3------------------------------C-------------------496.8
------------------------------------------- 0.9
The slave table
Demande---reservation---debit---credit---slaveamout---slavecorrection
1------------1------------D------------------------------------15.3---------------14.5
1------------2------------D------------------------------------480.6-------------480.6
1------------3-----------------------------C-------------------496---------------496
-------------------------------------------0.1--------------------------------------0.9
The reservation have a total amount of 0.1, but must be corrected to 0.9 because the main table has 0.9.
Reservation 1 requires a correction so the slave table also has a total of 0.9 (business rule is, only corrections on the first booking). So we have
to change the amount of 15.3 to 14.5. I plan my SQL like this:
1 reservations sum of two tables for each claim. Compare the two for each individual claim.
2. If Captain sum the amount shows a difference between master / slave
2.1 select top 1 table reservation slave for the specific claim and increase/decrease by the difference of these two amounts.
Who is?Hello
Use MERGE to actually do the UPDATE.
The ROW_NUMBER analytic function to identify the first booking in slave (unless you can count on which the reservation = 1).MERGE INTO slave dst USING ( WITH master_summary AS ( SELECT claim , SUM ( master_ampount * CASE WHEN debit = 'D' THEN -1 WHEN credit = 'C' THEN 1 END ) AS balance FROM master GROUP BY claim ) SELECT s.claim , s.booking , SUM ( s.slave_amount * CASE WHEN s.debit = 'D' THEN -1 WHEN s.credit = 'C' THEN 1 END ) OVER (PARTITION BY claim) - m.balance AS diff , ROW_NUMBER () OVER ( PARTITION BY claim ORDER BY booking ) AS r_num FROM master_summary m JOIN slave s ON m.claim = s.claim ) src ON ( src.claim = dst.claim AND src.r_num = 1 ) WHEN MATCHED THEN UPDATE SET dst.debit = CASE WHEN src.diff < 0 THEN 'D' ELSE NULL END , dst.credit = CASE WHEN src.diff < 0 THEN NULL ELSE 'C' END , dst.slaveamount = ABS (src.diff) ;
If you would care to CREATE TABLE and INSERT statements for the sample data (showing the two tables, as they exist before the DML) then I could test this.
The design of history seems very uncomfortable. Instead of the debit and credit columns, it would be much simpler to have positive and negative amounts. Is it really worth now both not corrected and corrected the amounts in the table on the slave, especially if you keep only versions corrected debit and credit columns?
-
How to read the two columns of data in a file of PDM.
Hi all
I am reading two data columns for the 2nd of a PDM file two sheets, as shown below.
Two columns of data must then be shared so they can be displayed in a xy chart and also apply a linear adjustment VI. I implemented the graph xy and linear adjustment using a txt file (see below), therefore all the outputs work, however this application with a tdms file turns a little more tax.
So, essentially, that I don't know how read the correct leaf and therefore the columns in the PDM file and then how to produce the graph xy and linear adjustment of the data types produce. Here's my current attempt, which produces several errors of the type of terminal, as well as not being able to select the exact data in the PDM.
Any help/suggestions/example vi on this asap would be greatly appreciated.
Thanks in advance,
Pete
Also the PDM file viewer. VI helps you easily understand the structure of data files.
-
How to read the two columns of data from the Port series
Hello
I'm reading two columns of data from the serial port.
Example:
52439 52430
52440 52437
52209 52214
51065 51070
52206 52390
I use the serial of Visa service and I can read the first column of data from the serial port, but I can't understand how to read the second column.
I want to both sets of chart data.
I enclose my VI.
Thank you for your help.
The analysis of string function takes a "Format string" on top (with the right button of the function and choose Help, which explains all the entries). In particular, you can say 'Give me two numbers separated by a tab' and the output will be two numbers (whole or floating, depending on the chosen format). In particular, %d\t%d specifies a decimal integer,
, whole decimal. -
Combine the two columns of the table
SELECT providerid, Sum OF appdev.usercounts
WHERE the counttime BETWEEN SYSDATE - 30/1440 AND SYSDATE-15/1440 GROUP BY ORDER BY providerid providerid
697 W
U 813
T 143
S 2
SELECT providerid, Sum OF appdev.usercounts
WHERE the counttime BETWEEN - 30/1440 AND (SYSDATE-1) - 15/1440 (SYSDATE-1) GROUP BY ORDER BY providerid providerid;
450 W
U 571
T 80
S 2
I want output like
W 697 450
U 813 571
143 80 T
2 2 S
Help, please
Thank you
Praveen'COUNT', which is the actual column name? It could become very confusing.
Not tested for obvious reasons, but it should be close:
SELECT providerid , sum( case when counttime between sysdate - 30/1440 and sysdate - 15/1440 then count end ) as cnt1 , sum( case when counttime between (sysdate-1) - 30/1440 and (sysdate-1) - 15/1440 then count end ) as cnt2 FROM appdev.usercounts WHERE ( counttime between sysdate - 30/1440 and sysdate - 15/1440 ) OR ( counttime between (sysdate-1) - 30/1440 and (sysdate-1) - 15/1440 ) GROUP BY providerid ORDER BY providerid ;
-
Help the release of the two column list
Hello
I have two columns from two different tables. How can I write a query to list the information in a column of result?
I have
What I want isTABLE A TABLE B _Column A_ _Column B_ a d b e c f
Any help appreciated hereRESULT_COLUMN a b c d e f
Thank youSelect column_a table_a
Union
Select table_b column_b; -
How to put the two column values in two different colors unique online: MobApp
Hello
I develop Mobile Application.
I want to show two values in different columns in single row and first column value in either green or red and the second color the default column value.
the first value of the column is green when the value is greater than the second value of the column.
and the first column value in red when the value is less than the second value of the column.
The code I tried is:
--------------------------------------------------------------------------------------------
< tr:panelGroupLayout layout = "vertical" styleClass = 'list' >
< tr:panelList styleClass = "panelist ul > li > a" >
"" < tr:outputText value = "deliver: % #{row.bindings.OccCurr.inputValue},
inlineStyle = "background-color: #{rank." OccCurr > line. OccFcst? {'Green': 'Red'}; ">
"< tr:outputText value =" OccFcst: #{row.bindings.OccFcst.inputValue} % ">"
< / tr:outputText >
< / tr:outputText >
< / tr:panelList >
< / tr:panelGroupLayout >
------------------------------------------------------------------------------------------------
But the code above does not work.
Please, someone tell me what I need to do.
I apreciate your time and your help.
Sanchez.Hi Catherine,
Exactly, what is not working? Your OccCurr and OccFcst values are printed to the screen? I notice some questions.
(1) If you want to display two outputText on one line, you can surround them with a panelGroupLayout and set the page layout to horizontal.
(2) I don't think that you can place an outputText in outputText one another as in the codes that you have provided.
(3) your EL is inconsistent. What is #{row.bindings.OccCurr.inputValue} or #{line. OccCurr}? If your values are displayed, but the background color does not work, it could be the first.Kind regards
Amélie Chan -
Combine the two columns?
HI, the problem is this, I have two columns: start_date and end_date
Invite a: start date (for example 08/08/2008)
Invite two: End Date (for ouvertede 30/04/2009)
so these are two different columns, do you know how get all the data between these two dates.
If I use the "between the function" I can't get the dates between the same column,
The start date
The start date
but I need the end date...
I really appriciate to help
Thank youHello
Something like:
SELECT * FROM
WHERE start_date BETWEEN TO_DATE('08/08/2008', 'mm/dd/yyyy') AND TO_DATE('04/30/2009', 'mm/dd/yyyy') OR end_date BETWEEN TO_DATE('08/08/2008', 'mm/dd/yyyy') AND TO_DATE('04/30/2009', 'mm/dd/yyyy'); Kind regards
-
"How do you build a filter based on the conditions of the two columns?
Hi all
line desc period Amount1 Amount2
Jan Feb 10 0
Tue Jan 20 0
Jan jan 30 0
Jan - Apr 0 40
I have such a report with four columns
Line Descr is a table and other period table and amounts 1 and are 2 respective amounts.
now I need to see the only column in the result i, e. jan jan 30 0
I need to write a sql in the formula in the column so that I need to get this result
Any suggestions as what sql what I write
Thank you
Xavier.
Published by: Xavier on July 1st, 2011 12:03
Published by: Xavier on July 1st, 2011 12:04
Published by: Xavier on July 1st, 2011 12:05
Published by: Xavier on July 1st, 2011 12:05
Published by: Xavier on July 1st, 2011 12:06
Published by: Xavier on July 1st, 2011 12:07
Published by: Xavier on July 2, 2011 11:37OK, so try it this way.
(1) take another column. Click on the fx, delete the content and enter this:
CASE WHEN tablename. Line_Desc = tablename. Period THEN put END to 'Y' ELSE ' n
(2) put a filter on this column = 'Y '.
It should work.
-
Filter the two columns with a variable
Hi guys!
I am new to Oracle BI EE and I following the task at hand.
In my database, I've followed columns:
ID | VALUE | VALID_FROM | VALID_TO
The first is the unique ID, the second value I need to show my analysis, the latter two are dates.
I need to prepare the analysis when user asks values at a time, so I'll have to show all lines where the date selected by the user is greater than VALID_FROM and smaller than VALID_TO (but the user must enter only once).
I am a complete beginner and have no idea how prepare this analysis? Could you give me some advice?
Best regards
Greg
I did not understand your exact need. A date value, will be user input.
For example: 01.08.2014, then your analysis will be filtered by;
01.08.2014 > VALID_FROM and
01.08.2014<>
If so, you can create a prompt for dashboard column and give set a presentation for this column. Then, you will use this presentation for valid_from and valid_to columns column.
-
Update, one of the two columns based on a condition
I have this example table:
Lead_ID
Mailed_Date
Campaign of
Model
MPI
MP2
100
August 2, 12
Travel_Check
US_Air
null
null
200
August 2, 12
Travel_Check
US_Air
1099
null
MP1 and MP2 columns represent mailpiece_IDs (marketing mail that was sent). MP1 is the first piece in the mail and MP2 is the second room that receives mail. Here Lead_id 100 received no mail and Lead_id 200 received the first piece.
I want my update to allow me to update MP1 IF MP1 is null, but if MP1 is worth, I want MP2 to update. So if I update with a new post 2000 article ID the result should look like this after the update. Lead_ID 100 received a piece of mail, and 200 Lead_ID received two parts:
Lead_ID
Mailed_Date
Campaign of
Model
MPI
MP2
100
August 2, 12
Travel_Check
US_Air
2000
null
200
August 2, 12
Travel_Check
US_Air
1099
2000
I tried this case and I thought that maybe I could choose the field with COALESCE, but which doesn't seem to work. Can anyone help?
Hello
Here's another way to do it:
UPDATE yourtable
Mp1 SET = NVL (mp1, 2000)
mp2 = NVL2 (mp1, mp2 2000)
WHERE LESS (mp1, mp2) IS NULL
;
In any case, there are 2 columns that could be changed, so you should have 2 columns listed in the SET clause. It does not matter that one or these columns will be always equal to itself.
Maybe you are looking for
-
Bar does not address of Firefox
I enter a URL in the address bar, press ENTER, the browser starts to act like he is going to go to the address of the request and then stops. The browser will not anywhere, go except the web Google pages, if I use the google search on the home page.
-
I need a port Hi-Speed USB Satellite 5100 503
Hello They gave me an I - pod for Christmas, but when I connect it says am I need a USB Hi-Speed port that does not have this model. Message comes up saying I need to get a Hi-Speed USB Host Controller - any advice on which would be best for employme
-
Office Jet Pro 8610: El Capitan problem - error =-19 unsupported color space
Q: problem for you to connect to HP Office Jet Pro 8610 Apple - iMac 21.5 "®-Intel Core i5 (1.6 GHz) - memory of 8 GB - 1 TB hard" El CapitanPrinter: HP OfficeJet Pro 8610Help my printer set-up of mother-in-law to his new iMac. Wi - Fi connection; It
-
Svchost error when restarting the computer
Original title: svchost 0xc00000fd application 0x77504e53
-
Can not find new messages to sms, I was informed about everything in SMS
Hey there, Just getting used to the new z3 xperia phone. While in the middle of texting a contact of mine, I received notifications that new sms messages had arrived (I had previously sent me friends text their number). After finishing the text I was