Help required in creating a QUERY!!!
hi my name is johnny. I am new to this forums.
My question is
"There are 4 players in a team and that team played 4 matches. The scores for player1: 34,44,23,9. player2: 12,15,62,40. player3: 54,65,34,82. player4: 77,53,69,88. in four inning in four matches respectively. So my question is that i want highest score of each player in a column in the desceding order."
Sample output:
player_name test1 test2 test3 test4 highest_score
player4 77 53 69 88 88
player3 54 65 34 82 82
player2 12 15 62 40 62
player1 34 44 23 09 44
Can you tell us how your data is stored in the database. I mean what is the table structure of the table that stores the data for all the inings and scores for all the players?
Faisal.
Similar Messages
-
I need to fetch records from a table. Please help me to create a query
The Tablename is Employee. It has the following records
Department Empname Gender
Finance Tom Male
Finance Rick Male
Finance Stacy Female
Corporate Tom Male
Corporate Rob Male
I want to select the value of the Gender field from the Employee table corresponding to a Department
If all the values in the Gender field are 'MALE' corresponding to 'finance' in the Department field, the value should be 'MALE'
If there is a value 'FEMALE', the gender corresponding to the Empname 'TOM' should be considered as the genderTables have rows - not records.
Your question is a basic SQL language question - which means you do not know the SQL language. This forum is not a classroom for teaching you the SQL language.
Use the following as the basic outline of how your SQL language statement need to look like for selecting the required from the table:
SELECT
<<sql projection goes here>>
FROM <<table name goes here>>
WHERE <<filter conditions go here>>
{code}
The SQL projection specifies the list of columns the SQL need to return to the caller.
The filter condition is basic predicates and AND and OR can be used for multiple predicates.
Go to http://tahiti.oracle.com and look for the +SQL Reference Guide+ for the Oracle version you are using. The +SELECT+ statement syntax is covered in detail and sample statements are provided.
And please do not expect this forum to be used as a classroom, or expect this forum to do your homework for a class. -
Help: How to create a query like this?
I am working on a report and I am facing on a question like this:
TABLE TEST has two columns A and B
A B
2 INFO21
2 INFO22
3 INFO31
3 INFO32
3 INFO33
I'd like to create a query which will return
A INFO
2 INFO21, INFO22
3 INFO31, INFO32, INFO33
Please help.
Thank you in advance
JimmyA lot of pretty fine examples here:
http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php
Rgds. -
Help: How to create a query that transpose the column content?
Here, suppose that I have two tables
TAB_A:
ID TYPE
1 AA
1 AB
1 AC
2 BA
2 BB
2 BC
2 BD
I'd like to create a query that gives result as:
ID TYPE
1 AA AB AC
2 BA BB BC BD Any suggestions?
Thank you in advance.
JimmyHi
Try this:
SELECT id,
replace(LTRIM(MAX(SYS_CONNECT_BY_PATH(type,'*'))
KEEP (DENSE_RANK LAST ORDER BY curr),'*'),'*', ', ') AS type
FROM (SELECT id, type,
ROW_NUMBER() OVER (PARTITION BY id ORDER BY type) AS curr,
ROW_NUMBER() OVER (PARTITION BY id ORDER BY type) -1 AS prev
FROM tab_a)
GROUP BY id
CONNECT BY prev = PRIOR curr AND id = PRIOR id
START WITH curr = 1;
Ott Karesz
http://www.trendo-kft.hu -
Urgent Help required in Tunning this query
I have table ACCOUNT SPONSOR HOMESTORE ASH with more than 30 million rows.
My batch daily need to update or insert into this table from a temporary table TEMP_HSTRALCT. The data for temporary table is populated by below query which selects from two tables TRANSACTION POINTS and REDEMPTIONS.However both these tables are partitioned on date time and is run daily and this is running for hours.
Can anyone please help me on tuning this query
INSERT INTO temp_hstralct
(tmp_n_collector_account_num, tmp_v_location_id,
tmp_v_sponsor_id, tmp_v_source_file_name,
tmp_n_psc_insert_ind, tmp_n_psc_update_ind,
tmp_n_transaction_amount, tmp_n_transaction_points,
tmp_n_acc_insert_ind, tmp_n_ash_insert_ind,
tmp_n_col_insert_ind, tmp_n_check_digit,
tmp_n_collector_issue_num, tmp_n_csl_insert_ind,
tmp_v_offer_code, tmp_n_psa_insert_ind)
SELECT DISTINCT trp_n_collector_account_num account_num,
trp_v_location_id location_id,
trp_v_sponsor_id sponsor_id,
trp_c_creation_user batch_id, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0
FROM transaction_points, ACCOUNT, locations_master,homestores
WHERE hsr_v_accrual_allowed = 'Y'
AND trp_n_collector_account_num = ACCOUNT.acc_n_account_num(+)
AND ( ( ( ACCOUNT.acc_v_account_type = 'C'
OR ACCOUNT.acc_v_account_type IS NULL
AND hsr_v_b2c_accounts = 'Y'
OR ( ACCOUNT.acc_v_account_type = 'B'
AND hsr_v_nfb_accounts = 'Y'
OR ( ACCOUNT.acc_v_account_type = 'H'
AND hsr_v_hybrid_accounts = 'Y'
AND trp_d_creation_date_time BETWEEN SYSDATE-3
AND SYSDATE
AND trp_v_sponsor_id = 'JSAINSBURY'
AND trp_v_location_id =
locations_master.lnm_v_location_id
AND locations_master.lnm_v_partner_id = 'JSAINSBURY'
AND ( ( ( (INSTR
(hsr_v_store_status,
locations_master.lnm_c_location_status
) > 0
AND (INSTR
(hsr_v_store_type,
locations_master.lnm_c_location_type
) > 0
AND hsr_v_homestore_assignment = 'ST'
OR ( ( locations_master.lnm_c_homestore_ind =
'Y'
AND (INSTR
(hsr_v_store_status,
locations_master.lnm_c_location_status
) > 0
AND hsr_v_homestore_assignment = 'HS'
UNION ALL
SELECT DISTINCT rdm_n_collector_account_num account_num,
rdm_v_location_id location_id,
rom_v_supplier_id sponsor_id,
rdm_c_creation_user batch_id, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0
FROM redemption_details,
reward_offer_master,
ACCOUNT,
locations_master,
HOMESTORES
WHERE hsr_v_redemption_allowed = 'Y'
AND rdm_n_collector_account_num = ACCOUNT.acc_n_account_num(+)
AND ( ( ( ACCOUNT.acc_v_account_type = 'C'
OR ACCOUNT.acc_v_account_type IS NULL
AND hsr_v_b2c_accounts = 'Y'
OR ( ACCOUNT.acc_v_account_type = 'B'
AND hsr_v_nfb_accounts = 'Y'
OR ( ACCOUNT.acc_v_account_type = 'H'
AND hsr_v_hybrid_accounts = 'Y'
AND rdm_d_creation_date_time BETWEEN SYSDATE-3
AND SYSDATE
AND rom_v_reward_offer_id = rdm_v_reward_id
AND rom_v_supplier_id = 'JSAINSBURY'
AND rdm_v_location_id =
locations_master.lnm_v_location_id
AND locations_master.lnm_v_partner_id ='JSAINSBURY'
AND ( ( ( (INSTR
(hsr_v_store_status,
locations_master.lnm_c_location_status
) > 0
AND (INSTR
(hsr_v_store_type,
locations_master.lnm_c_location_type
) > 0
AND hsr_v_homestore_assignment = 'ST'
OR ( ( locations_master.lnm_c_homestore_ind =
'Y'
AND (INSTR
(hsr_v_store_status,
locations_master.lnm_c_location_status
) > 0
AND hsr_v_homestore_assignment = 'HS'
);I have copied the explain as it is and can you please try pasting in the text pad.Can you let me know whether parallel hint on this will speed up the select queries.
Plan
INSERT STATEMENT CHOOSECost: 410,815 Bytes: 2,798,394 Cardinality: 15,395
32 UNION-ALL
15 SORT UNIQUE Cost: 177,626 Bytes: 2,105,592 Cardinality: 11,896
14 FILTER
13 HASH JOIN Cost: 177,312 Bytes: 2,105,592 Cardinality: 11,896
2 TABLE ACCESS BY INDEX ROWID LMHOLTP.LOCATIONS_MASTER Cost: 37 Bytes: 23,184 Cardinality: 966
1 INDEX RANGE SCAN NON-UNIQUE LMHOLTP.IX_LOCATIONS_MASTER_3 Cost: 3 Cardinality: 1
12 FILTER
11 HASH JOIN OUTER
8 MERGE JOIN CARTESIAN Cost: 155,948 Bytes: 702,656,660 Cardinality: 4,845,908
3 TABLE ACCESS FULL LMHOLTP.HOMESTORES Cost: 2 Bytes: 104 Cardinality: 1
7 BUFFER SORT Cost: 155,946 Bytes: 198,682,228 Cardinality: 4,845,908
6 PARTITION RANGE ITERATOR Partition #: 12
5 TABLE ACCESS BY LOCAL INDEX ROWID LMHOLTP.TRANSACTION_POINTS Cost: 155,946 Bytes: 198,682,228 Cardinality: 4,845,908 Partition #: 12
4 INDEX RANGE SCAN NON-UNIQUE LMHOLTP.IX_TRANSACTION_POINTS_1 Cost: 24,880 Cardinality: 6,978,108 Partition #: 12
10 PARTITION RANGE ALL Partition #: 15 Partitions accessed #1 - #5
9 TABLE ACCESS FULL LMHOLTP.ACCOUNT Cost: 6,928 Bytes: 68,495,680 Cardinality: 8,561,960 Partition #: 15 Partitions accessed #1 - #5
31 SORT UNIQUE Cost: 233,189 Bytes: 692,802 Cardinality: 3,499
30 FILTER
29 FILTER
28 NESTED LOOPS OUTER
24 HASH JOIN Cost: 226,088 Bytes: 664,810 Cardinality: 3,499
16 TABLE ACCESS FULL LMHOLTP.REWARD_OFFER_MASTER Cost: 8 Bytes: 2,280 Cardinality: 114
23 HASH JOIN Cost: 226,079 Bytes: 8,327,280 Cardinality: 48,984
20 TABLE ACCESS BY INDEX ROWID LMHOLTP.LOCATIONS_MASTER Cost: 37 Bytes: 432 Cardinality: 18
19 NESTED LOOPS Cost: 39 Bytes: 2,304 Cardinality: 18
17 TABLE ACCESS FULL LMHOLTP.HOMESTORES Cost: 2 Bytes: 104 Cardinality: 1
18 INDEX RANGE SCAN NON-UNIQUE LMHOLTP.IX_LOCATIONS_MASTER_3 Cost: 3 Cardinality: 966
22 PARTITION RANGE ITERATOR Partition #: 28
21 TABLE ACCESS FULL LMHOLTP.REDEMPTION_DETAILS Cost: 226,019 Bytes: 261,636,270 Cardinality: 6,229,435 Partition #: 28
27 PARTITION RANGE ITERATOR Partition #: 30
26 TABLE ACCESS BY LOCAL INDEX ROWID LMHOLTP.ACCOUNT Cost: 2 Bytes: 8 Cardinality: 1 Partition #: 30
25 INDEX UNIQUE SCAN UNIQUE LMHOLTP.CO_PK_ACCOUNT Cost: 1 Cardinality: 1 Partition #: 30 -
Transport Required when Creating New Query
I am attempting to create a new query on an InfoProvider which has several existing queries written on it. After I have created the query in development when I attempt to save the query I receive an error saying the "query could not be saved due to a problem in transport. BEx transport request '' is not available or suitable".
It appears that the system is looking for a BEx transport to be assigned via RSA1 but since this is a new report I believe I should be able to save the report to TMP and assign a transport at a later time.
Am I correct in my assumption and, if so, any thoughts why I'm receiving this error?Hi Jonathan,
Unfortunately, you do need a transport request if you are using already transported objects in yur new query definition. Even if you assign a request in RSA1 > transport connection, you will need to log out and logback into BEx before you can save your query. As an option and to save part of your development effort, you can remove these objects from your definition and save it. Then log out, assign a request and log back into BEx and then add the other objects to your query.
About the points: There seems to be something wrong with it for the past couple of days and I assume SDN is working to fix it. May be you can check back later and see if it is available... -
Help required in optimizing the query response time
Hi,
I am working on a application which uses a jdbc thin client. My requirement is to select all the table rows in one table and use the column values to select data in another table in another database.
The first table can have maximum of 6 million rows but the second table rows will be around 9000.
My first query is returning within 30-40 milliseconds when the table is having 200000 rows. But when I am iterating the result set and query the second table the query is taking around 4 millisecond for each query.
the second query selection criteria is to find the value in the range .
for example my_table ( varchar2 column1, varchar2 start_range, varchar2 end_range);
My first query returns a result which then will be used to select using the following query
select column1 from my_table where start_range < my_value and end_range> my_value;
I have created an index on start_range and end_range. this query is taking around 4 millisseconds which I think is too much.
I am using a preparedStatement for the second query loop.
Can some one suggest me how I can improve the query response time?
Regards,
ShyamTry the code below.
Pre-requistee: you should know how to pass ARRAY objects to oracle and receive resultsets from java. There are 1000s of samples available on net.
I have written a sample db code for the same interraction.
Procedure get_list takes a array input from java and returns the record set back to java. You can change the tablenames and the creteria.
Good luck.
DROP TYPE idlist;
CREATE OR REPLACE TYPE idlist AS TABLE OF NUMBER;
CREATE OR REPLACE PACKAGE mypkg1
AS
PROCEDURE get_list (myval_list idlist, orefcur OUT sys_refcursor);
END mypkg1;
CREATE OR REPLACE PACKAGE BODY mypkg1
AS
PROCEDURE get_list (myval_list idlist, orefcur OUT sys_refcursor)
AS
ctr NUMBER;
BEGIN
DBMS_OUTPUT.put_line (myval_list.COUNT);
FOR x IN (SELECT object_name, object_id, myvalue
FROM user_objects a,
(SELECT myval_list (ROWNUM + 1) myvalue
FROM TABLE (myval_list)) b
WHERE a.object_id < b.myvalue)
LOOP
DBMS_OUTPUT.put_line ( x.object_name
|| ' - '
|| x.object_id
|| ' - '
|| x.myvalue
END LOOP;
END;
END mypkg1;
[pre]
Testing the code above. Make sure dbms output is ON.
[pre]
DECLARE
a idlist;
refc sys_refcursor;
c number;
BEGIN
SELECT x.nu
BULK COLLECT INTO a
FROM (SELECT 5000 nu
FROM DUAL) x;
mypkg1.get_list (a, refc);
END;
[pre]
Vishal V. -
Help required in refining a query
I have a sql query :
select C1 AS No_Of_Completed_WOs, C2 as Wos_with_Soft_Fail, (C1-C2) as Completed_Wos,C3 as Failed_Wos,C4 as TimedOut_Wos from (select (CASE WHEN TBL_WRK_ORD.EXTSYS_ID IS NULL THEN '<NULL>'
ELSE TBL_WRK_ORD.EXTSYS_ID END),
count(case when WO_STAT=104 AND XACTION_TYPE like '%Completion%' then WO_STAT end ) as C1,
count(case when WO_STAT=104 AND XACTION_TYPE like '%Soft Error%' then WO_STAT end ) AS C2,
count(case when WO_STAT=253 then WO_STAT end ) AS C3,
count(case when WO_STAT=251 then WO_STAT end ) AS C4
from TBL_WRK_ORD,TBL_WO_EVENT_QUEUE WHERE TBL_WRK_ORD.WO_ID=TBL_WO_EVENT_QUEUE.WO_ID group by TBL_WRK_ORD.EXTSYS_ID)
The query basically maintains a separate counter for each of the qualifying condition.
C1 : if the WO_STAT is 104 and XACTION_TYPE is '%Completion%'
C2 : if the WO_STAT is 104 and XACTION_TYPE is '%Soft Error%'
C3 : if the WO_STAT is 253
C4 : if the WO_STAT is 251.
Now, the requirement is that we need to fetch distinct records, based on which the summation will be carried upon.
I was not able to incorporate the "distinct" logic in the above query.
Required help in this regards, as how to fetch distinct records and use it in the summation logic.
A quick help would be appreciated and thankful.
Regards
RAT.
Edited by: user9546298 on Feb 24, 2010 6:36 AM
Edited by: user9546298 on Feb 24, 2010 7:06 AMHere is the sample data :
{code }
Table : TBL_WRK_ORD
WO_ID SCHED_DTS WO_STAT
EXTSYS_ID
A00000001-QRY_ISUP_SERVICE_L 20091126 03:28:02 103
MRK
A00000002-S3 20091201 02:42:34 255
MRK
A00000003-A4 20091201 02:50:28 253
A00000006-ADD1 20091202 05:37:45 104
A00000004-ADD1 20091201 03:40:39 104
A00000005-DNH1 20091202 05:12:06 253
6 rows selected.
Table : TBL_WO_EVENT_QUEUE
WO_ID XACTION_TYPE
A00000001-QRY_ISUP_SERVICE_L WO Accept
A00000001-QRY_ISUP_SERVICE_L WO Startup
A00000001-QRY_ISUP_SERVICE_L WO Completion
A00000002-S3 WO Accept
A00000003-A4 WO Accept
A00000003-A4 WO Startup
A00000003-A4 WO Rollback
A00000003-A4 WO Failure
A00000005-DNH1 WO Rollback
A00000005-DNH1 WO Failure
A00000006-ADD1 WO Accept
A00000006-ADD1 WO Startup
A00000004-ADD1 WO Accept
A00000004-ADD1 WO Startup
A00000004-ADD1 WO Completion
A00000005-DNH1 WO Accept
A00000005-DNH1 WO Startup
A00000006-ADD1 WO Completion
Current output :
NO_OF_COMPLETED_WOS WOS_WITH_SOFT_FAIL COMPLETED_WOS FAILED_WOS TIMEDOUT_WOS
2 0 2 8 0
0 0 0 0 0
Here, as you can see above that the result has duplicates, which caused the counters to show wrong result.
Now, the query should filter based on given criteria and produce the count of the filtered rows.
But doing so, should consider distinct rows for counting.
Also, just placing distinct at counting logic [ pasted by you ] didnot work. I tried it out, but in vain.
Regards
RAT.
Edited by: user9546298 on Feb 24, 2010 7:09 AM -
Help required of creating Oracle RAC database having multiple instances
Hello Guys!
I want to create one database having 2 instances on Oracle 11g R1
I have 2 nodes in this Oracle RAC
Database name will be Val
and instance name on node 1 will be val1 and instance name on node 2 will be val2
Raw storage will be used, that is, without using automatic storage management or an Oracle Cluster File System
Can anyone help how to do that ?
ThanksHi,
Wonderful example thanks for the link.You're welcome :)
I'm little confused which option to choose in shared storage option of DBCA
i.e. Cluster File System or Raw devices?I suggest you to use ASM for you database storage requirement and select raw devices. oracle recommends to use ASM storage for sahred database.
thanks,
X A H E E R -
URGENT HELP REQUIRED _ Creating Labels for Triangle
Hi everyone... the code below is my application - Pythagoras Theorem.. or rather displaying it.. But i have not been able to get the Vertex of the triangle Labelled as A B C... I need to do that and change the Triangle Table data to A B C insted of Horizontal Vertical and Hypotenuise and as the triangle is stretched on screen A B And C keep moving as well ...
Besides i need to Show this in the tabel
- Values of A ^ 2 , B^2 and C ^2 as welll as a row showing A^2+B^2 = C^2
the code is as follows..
This is the main class called Geometry
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.text.NumberFormat;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.DefaultTableCellRenderer;
import java.lang.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import java.awt.FileDialog;
import java.io.*;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import javax.swing.JFrame;
public class Geometry {
CardLayout cards;
JPanel panel;
public Geometry() {
cards = new CardLayout();
panel = new JPanel(cards);
addCards();
JFrame f = new JFrame("Geometry");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setJMenuBar(getMenuBar());
f.getContentPane().add(panel);
f.setSize(500,500);
f.setLocation(0,0);
f.setVisible(true);
f.addMouseMotionListener(
new MouseMotionListener() { //anonymous inner class
//handle mouse drag event
public void mouseMoved(MouseEvent e) {
System.out.println("Mouse " + e.getX() +"," + e.getY());
public void mouseDragged(MouseEvent e) {
System.out.println("Draggg: x=" + e.getX() + "; y=" + e.getY());
// public void mouseMoved(MouseEvent me) {
// System.out.println("Moving: x=" + me.getX() + "; y=" + me.getY());
// panel.addMouseMotionListener(
// new MouseMotionListener() { //anonymous inner class
// //handle mouse drag event
// public void mouseDragged(MouseEvent me) {
// setTitle("Dragging: x=" + me.getX() + "; y=" + me.getY());
// public void mouseMoved(MouseEvent me) {
// setTitle("Moving: x=" + me.getX() + "; y=" + me.getY());
private void addCards() {
// card one
TriangleModel tri = new TriangleModel(175,100,175,250,325,250);
TriangleView view = new TriangleView(tri);
JPanel panelOne = new JPanel(new BorderLayout());
panelOne.add(view.getUIPanel(), "North");
panelOne.add(view);
panelOne.add(view.getTablePanel(), "South");
panelOne.setName("Pythagoras's Theorem");
panel.add("Pythagoras's Theorem", panelOne);
view.addMouseMotionListener(
new MouseMotionListener() { //anonymous inner class
//handle mouse drag event
public void mouseMoved(MouseEvent e) {
System.out.println("Mouse at " + e.getX() +"," + e.getY());
public void mouseDragged(MouseEvent e) {
System.out.println("Dragging: x=" + e.getX() + "; y=" + e.getY());
// card two
TestModel trin = new TestModel(175,100,175,250,325,250);
TestView viewn = new TestView(trin);
JPanel panelTwo = new JPanel(new BorderLayout());
panelTwo.add(viewn.getUIPanel(), "North");
// panelTwo.setBackground(Color.blue);
panelTwo.setName("Similar Triangles");
panelTwo.add(viewn);
panelTwo.add(viewn.getTablePanel(), "South");
viewn.addMouseMotionListener(
new MouseMotionListener() { //anonymous inner class
//handle mouse drag event
public void mouseMoved(MouseEvent e) {
System.out.println("Mouse at " + e.getX() +"," + e.getY());
public void mouseDragged(MouseEvent e) {
System.out.println("Dragging: x=" + e.getX() + "; y=" + e.getY());
panel.add("Similar Triangles", panelTwo);
JPanel panelThree = new JPanel();
panelThree.setBackground(Color.white);
panelThree.setName("Circle Theorem1");
panel.add("Circle Theorem1", panelThree);
private JMenuBar getMenuBar() {
JMenu File = new JMenu("File");
JSeparator separator1 = new JSeparator();
JMenuItem Open = new JMenuItem("Open");
// Open.addActionListener(new java.awt.event.ActionListener() {
// public void actionPerformed(java.awt.event.ActionEvent evt) {
// openActionPerformed(evt);
JMenuItem Save = new JMenuItem("Save");
JMenuItem Print = new JMenuItem("Print");
JMenuItem Exit = new JMenuItem("Exit");
Exit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ExitActionPerformed(evt);
JMenu theorem = new JMenu("Theorem");
ActionListener l = new ActionListener() {
public void actionPerformed(ActionEvent e) {
JMenuItem item = (JMenuItem)e.getSource();
String name = item.getActionCommand();
cards.show(panel, name);
Component[] c = panel.getComponents();
for(int j = 0; j < panel.getComponentCount(); j++) {
String name = c[j].getName();
JMenuItem item = new JMenuItem(name);
item.setActionCommand(name);
item.addActionListener(l);
theorem.add(item);
JMenuBar menuBar = new JMenuBar();
JMenuBar menuBar1 = new JMenuBar();
menuBar.add(File);
File.add(Open);
File.add(separator1);
File.add(Save);
File.add(Print);
File.add(Exit);
menuBar.add(theorem);
return menuBar;
// private void openActionPerformed(java.awt.event.ActionEvent evt) {
// FileDialog fileDialog = new FileDialog(this, "Open...", FileDialog.LOAD);
// fileDialog.show();
// if (fileDialog.getFile() == null)
// return;
// fileName = fileDialog.getDirectory() + File.separator + fileDialog.getFile();
// FileInputStream fis = null;
// String str = null;
// try {
// fis = new FileInputStream(fileName);
// int size = fis.available();
// byte[] bytes = new byte [size];
// fis.read(bytes);
// str = new String(bytes);
// } catch (IOException e) {
// } finally {
// try {
// fis.close();
// } catch (IOException e2) {
// if (str != null)
// textBox.setText(str);
private void ExitActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
System.exit(0);
public static void main(String[] args) {
new Geometry();
}import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.text.NumberFormat;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.DefaultTableCellRenderer;
public class Triangle
public Triangle()
TriangleModel tri = new TriangleModel(175,100,175,250,325,250);
TriangleView view = new TriangleView(tri);
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(view.getUIPanel(), "North");
f.getContentPane().add(view);
f.getContentPane().add(view.getTablePanel(), "South");
f.setSize(500,500);
f.setLocation(200,200);
f.setVisible(true);
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import javax.swing.JTable;
import javax.swing.event.MouseInputAdapter;
* TriangleControl.java
* Created on 06 February 2005, 01:19
* @author Rahindra Naidoo
public class TriangleControl extends MouseInputAdapter
TriangleView view;
TriangleModel model;
Point start;
boolean dragging, altering;
Rectangle lineLens; // used for line selection
public TriangleControl(TriangleView tv)
view = tv;
model = view.getModel();
dragging = altering = false;
lineLens = new Rectangle(0, 0, 6, 6);
public void mousePressed(MouseEvent e)
Point p = e.getPoint();
lineLens.setLocation(p.x - 3, p.y - 3);
// are we over a line
if(model.isLineSelected(lineLens))
start = p;
altering = true;
// or are we within the triangle
else if(model.contains(p))
start = p;
dragging = true;
public void mouseReleased(MouseEvent e)
altering = false;
dragging = false;
view.getCentroidLabel().setText("centroid location: " +
model.findCentroid());
view.repaint(); // for the construction lines
public void mouseDragged(MouseEvent e)
Point p = e.getPoint();
if(altering)
int x = p.x - start.x;
int y = p.y - start.y;
model.moveSide(x, y, p);
updateTable();
view.repaint();
start = p;
else if(dragging)
int x = p.x - start.x;
int y = p.y - start.y;
model.translate(x, y);
view.repaint();
start = p;
private void updateTable()
String[] lengths = model.getLengths();
String[] squares = model.getSquares();
String[] angles = model.getAngles();
JTable table = view.getTable();
for(int j = 0; j < angles.length; j++)
table.setValueAt(lengths[j], 1, j + 1);
table.setValueAt(squares[j], 2, j + 1);
table.setValueAt(angles[j], 3, j + 1);
view.getCentroidLabel().setText("centroid location: " +
model.findCentroid());
* TriangleModel.java
* Created on 06 February 2005, 01:18
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.text.NumberFormat;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.DefaultTableCellRenderer;
* @author Rahindra Naidoo
public class TriangleModel // (x1, y1)
{ // |\
static final int SIDES = 3; // | \
private int cx, cy; // | \
Polygon triangle; // |_ _\ (x3, y3)
int selectedIndex; // (x2, y2)
NumberFormat nf;
Line2D[] medians;
Point2D centroid;
public TriangleModel(int x1, int y1, int x2, int y2, int x3, int y3)
int[] x = new int[] { x1, x2, x3 };
int[] y = new int[] { y1, y2, y3 };
triangle = new Polygon(x, y, SIDES);
nf = NumberFormat.getNumberInstance();
nf.setMaximumFractionDigits(1);
public boolean contains(Point p)
// Polygon.contains doesn't work well enough
return (new Area(triangle)).contains(p);
public boolean isLineSelected(Rectangle r)
Line2D line = new Line2D.Double();
for(int j = 0; j < SIDES; j++)
int[] x = triangle.xpoints;
int[] y = triangle.ypoints;
int x1 = x[j];
int y1 = y[j];
int x2 = x[(j + 1) % SIDES];
int y2 = y[(j + 1) % SIDES];
line.setLine(x1, y1, x2, y2);
if(line.intersects(r))
selectedIndex = j;
return true;
selectedIndex = -1;
return false;
* Only works for right triangle with right angle at (x2, y2)
public void moveSide(int dx, int dy, Point p)
int[] x = triangle.xpoints;
int[] y = triangle.ypoints;
switch(selectedIndex)
case 0:
x[0] += dx;
x[1] += dx;
break;
case 1:
y[1] += dy;
y[2] += dy;
break;
case 2:
double rise = y[2] - y[0];
double run = x[2] - x[0];
double slope = rise/run;
// rise / run == (y[2] - p.y) / (x[2] - p.x)
x[2] = p.x + (int)((y[2] - p.y) / slope);
// rise / run == (p.y - y[0]) / (p.x - x[0])
y[0] = p.y - (int)((p.x - x[0]) * slope);
public void translate(int dx, int dy)
triangle.translate(dx, dy);
public Polygon getTriangle()
return triangle;
public String findCentroid()
int[] x = triangle.xpoints;
int[] y = triangle.ypoints;
// construct the medians defined as the line from
// any vertex to the midpoint of the opposite line
medians = new Line2D[x.length];
for(int j = 0; j < x.length; j++)
int next = (j + 1) % x.length;
int last = (j + 2) % x.length;
Point2D vertex = new Point2D.Double(x[j], y[j]);
// get midpoint of line opposite vertex
double dx = ((double)x[last] - x[next])/2;
double dy = ((double)y[last] - y[next])/2;
Point2D oppLineCenter = new Point2D.Double(x[next] + dx,
y[next] + dy);
medians[j] = new Line2D.Double(vertex, oppLineCenter);
// centroid is located on any median 2/3 the way from the
// vertex (P1) to the midpoint (P2) on the opposite side
double[] lengths = getSideLengths();
double dx = (medians[0].getX2() - medians[0].getX1())*2/3;
double dy = (medians[0].getY2() - medians[0].getY1())*2/3;
double px = medians[0].getX1() + dx;
double py = medians[0].getY1() + dy;
//System.out.println("px = " + nf.format(px) +
// "\tpy = " + nf.format(py));
centroid = new Point2D.Double(px, py);
return "(" + nf.format(px) + ", " + nf.format(py) + ")";
public String[] getAngles()
double[] lengths = getSideLengths();
String[] vertices = new String[lengths.length];
for(int j = 0; j < lengths.length; j++)
int opp = (j + 1) % lengths.length;
int last = (j + 2) % lengths.length;
double top = lengths[j] * lengths[j] +
lengths[last] * lengths[last] -
lengths[opp] * lengths[opp];
double divisor = 2 * lengths[j] * lengths[last];
double vertex = Math.acos(top / divisor);
vertices[j] = nf.format(Math.toDegrees(vertex));
return vertices;
public String[] getLengths()
double[] lengths = getSideLengths();
String[] lengthStrs = new String[lengths.length];
for(int j = 0; j < lengthStrs.length; j++)
lengthStrs[j] = nf.format(lengths[j]);
return lengthStrs;
public String[] getSquares()
double[] lengths = getSideLengths();
String[] squareStrs = new String[lengths.length];
for(int j = 0; j < squareStrs.length; j++)
squareStrs[j] = nf.format(lengths[j] * lengths[j]);
return squareStrs;
private double[] getSideLengths()
int[] x = triangle.xpoints;
int[] y = triangle.ypoints;
double[] lengths = new double[SIDES];
for(int j = 0; j < SIDES; j++)
int next = (j + 1) % SIDES;
lengths[j] = Point.distance(x[j], y[j], x[next], y[next]);
return lengths;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.text.NumberFormat;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.DefaultTableCellRenderer;
* TriangleView.java
* Created on 06 February 2005, 01:21
public class TriangleView extends JPanel
private TriangleModel model;
private Polygon triangle;
private JTable table;
private JLabel centroidLabel;
private boolean showConstruction;
TriangleControl control;
public TriangleView(TriangleModel model)
this.model = model;
triangle = model.getTriangle();
showConstruction = false;
control = new TriangleControl(this);
addMouseListener(control);
addMouseMotionListener(control);
public void paintComponent(Graphics g)
super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2.draw(triangle);
if(model.medians == null)
centroidLabel.setText("centroid location: " + model.findCentroid());
// draw medians and centroid point
if(showConstruction && !control.dragging)
g2.setPaint(Color.red);
for(int j = 0; j < 3; j++)
g2.draw(model.medians[j]);
g2.setPaint(Color.blue);
g2.fill(new Ellipse2D.Double(model.centroid.getX() - 2,
model.centroid.getY() - 2, 4, 4));
public TriangleModel getModel()
return model;
public JTable getTable()
return table;
public JLabel getCentroidLabel()
return centroidLabel;
public JPanel getUIPanel()
JCheckBox showCon = new JCheckBox("show construction");
showCon.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
boolean state = ((JCheckBox)e.getSource()).isSelected();
showConstruction = state;
repaint();
JPanel panel = new JPanel();
panel.add(showCon);
return panel;
public JPanel getTablePanel()
String[] headers = new String[] { "", "", "", "" };
// row and column data labels
String[] rowHeaders = {
"sides", "lengths", "squares", "angles", "degrees"
String[] sidesRow = { "vertical", "horizontal", "hypotenuse" };
String[] anglesRow = { "hyp to ver", "ver to hor", "hor to hyp" };
// collect data from model
String[] angles = model.getAngles();
String[] lengths = model.getLengths();
String[] squares = model.getSquares();
String[][] allData = { sidesRow, lengths, squares, anglesRow, angles };
int rows = 5;
int cols = 4;
Object[][] data = new Object[rows][cols];
for(int row = 0; row < rows; row++)
data[row][0] = rowHeaders[row];
for(int col = 1; col < cols; col++)
data[row][col] = allData[row][col - 1];
table = new JTable(data, headers)
public boolean isCellEditable(int row, int col)
return false;
DefaultTableCellRenderer renderer =
(DefaultTableCellRenderer)table.getDefaultRenderer(String.class);
renderer.setHorizontalAlignment(JLabel.CENTER);
centroidLabel = new JLabel("centroid location: ", JLabel.CENTER);
Dimension d = centroidLabel.getPreferredSize();
d.height = table.getRowHeight();
centroidLabel.setPreferredSize(d);
JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(BorderFactory.createTitledBorder("triangle data"));
panel.add(table);
panel.add(centroidLabel, "South");
return panel;
}PLEASE HELP ---- Also does any one know how to draw a Triangle on a screen which can be controlled by a JSlider such that as and whenits incremented the triangle increase and vice versa... I need to prove Similarity in triangles using A Jslider that controls one triangle while the other triangle is Still on screenSharan,
The code given was part of the assignment and you are supposed to make the changes for your part right?
Please give details of what you have done so far and not expect us to do your assignment for you. We'll be glad to help answer questions and point to the right direction, but giving us the entire assignment and saying, very nicely I might add, "Please do it for me." Just seems to make a mockery of the hours, days, and years that many of us has spent earning our degrees and learning our skills.
Work on it and ask specific questions with examples of what you have done and you'll get a much better response. -
Urgent help required in creating matrix table report
Hi
I need a report in the below format with subtotal and total and custom order of columns and rows. I tried in using grouping and conditional region format but i am not getting the exact result.
product2 product 1 product 3 Total
Asia
India 10 20 30 60
Europe
london 20 30 40 90
Germany 30 40 50 120
Europe total 50 70 90 210
Full total 60 90 120 270
india,london,germany in field region
product 1, product2 product3 in field sales
measures in total amount field
I tried to use the pivot table but their no option for total and custom ordering for rows and columns and i am not getting the exact format. Please suggest me a method or procedure to get exact result as shown above.
Thanks and regards
sandy
Edited by: user2989722 on Mar 31, 2010 11:45 PMhi
I am attaching my xml please help me out in creating a matrix report.
<?xml version="1.0" encoding="UTF-8" ?>
- <ROWSET>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 1 [0 - .15]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>2307.165535041</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.475123902700634</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>30.2162475006637</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>1632.57338858</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>422.436554415462</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 10 (10 - 20]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>17137.13228197</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.405705629282986</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>207.096250125078</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>5783.36069429</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>26.7447698210976</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 11 (20 - 100]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>176.01654684</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.507714108946292</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>281.219317996251</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>6.35288644</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>33.5503479625902</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 12 Default</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>4701.426500882</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.448602202841554</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>100.000000024971</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>722.25731111</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>17.1137302584326</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 4 (.35 - .5]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>20075.347155131</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.435471063386539</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>65.043256695741</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>19214.33530761</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>39.8394919447153</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 6 (.75 - 1.35]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>55148.040085827</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.406837969201374</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>90.9915692969898</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>35168.28645631</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>24.2323573228287</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 7 (1.35 - 2.5]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>80782.306502494</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.401398105436061</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>104.939383907255</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>29327.09937088</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>64.5404944514989</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 9 (5.5 - 10]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>19918.353466582</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.403197283094678</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>145.38568228759</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>6968.38716055</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>22.4602872356297</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>1.Wholesale</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD3 (.25 - .35]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>4659.00625848</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.437222745016593</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>49.7763165044685</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>6328.43285318</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>56.9420433188724</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 1 [0 - .15]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>92099.47315523</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.49290316215652</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>8.1614679611239</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>40865.81313468</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.490255140986887</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 10 (10 - 20]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>5978.77892414</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.462986581515473</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>236.956154182651</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>38.17433944</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.220028397461449</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 11 (20 - 100]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>7996.70429901</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.487633014729318</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>211.059294848823</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>67.39087733</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.262386150656619</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 12 Default</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>5680.79501712</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.364996338745224</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>100.000000120142</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>9.44825003</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.274957460858617</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 2 (.15 - .25]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>18412.32474058</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.565813759474568</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>22.0959615585123</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>3375.14793919</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.31511224146282</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 4 (.35 - .5]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>8998.50534758</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.564193157888767</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>38.7032364619711</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>742.52198983</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.259162668085142</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 5 (.5 - .75]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>8566.81402593</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.551881376840796</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>49.4634096178362</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>404.85624382</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>2.51892931053278</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 6 (.75 - 1.35]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>10002.21838595</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.530272891319008</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>66.6791470811157</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>404.88147998</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.212464766871609</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 7 (1.35 - 2.5]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>10005.26092357</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.500044162824778</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>93.5636951722772</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>-490.56397567</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>46.4764541038698</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 8 (2.5 - 5.5]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>11226.21172151</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.468571958403512</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>131.927474849119</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>110.85147102</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.214124061873538</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD 9 (5.5 - 10]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>5963.41956141</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.466066773663567</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>185.088689160792</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>51.01957931</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.224693875694723</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
- <ROW>
<_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>2.Residential Mortgage</_FCT_NON_SEC_EXP_20090331_._Line_of_Business_>
<_FCT_NON_SEC_EXP_20090331_._PD_Range_>PD3 (.25 - .35]%</_FCT_NON_SEC_EXP_20090331_._PD_Range_>
<_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>9956.41682925</_FCT_NON_SEC_EXP_20090331_._Total_exp_amount____1000000>
<_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>0.55994575388673</_FCT_NON_SEC_EXP_20090331_._Weighted_Average_LGD_>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>29.9353533062809</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_RW_>
<_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>1216.31690239</_FCT_NON_SEC_EXP_20090331_._Undrawn_Commitments__m_____1000000>
<_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>0.28824424910818</_FCT_NON_SEC_EXP_20090331_._Exposure_Weighted_Avg_EAD____1000000>
</ROW>
> -
Help Required on Creating and Maintaining an Apple Network Without a Server
Hi,
I'm an external IT technician for a new educational block at a hospital who intend on using apple mac computers alongside windows computers running off of a windows server..
I usually deal with windows XP as an operating system so OSX is relatively new to me..
Basically what I have is a suite of 6 iMacs which are all sharing files from the windows server via a network share drive I set up. I've just got off the phone with the project manager and she wishes to have individual logons for each member of staff and student here, this adds up to around 25 people..
I have allready created a generic "teacher" and "student" logon which has all of the right things in the dock + settings etc that I need. Is there an easy way to duplicate those settings to create new profiles?
I'm just trying to look for ways of making this easier for myself and for the school in the future.. I have a feeling that the ideal solution would be to have an apple server installed and manage the users from there but I don't think that it was considered at the time of purchase..
So can anyone help me out? I'll be grateful for any tips or advice on creating and maintaining this system as I'm due to support this place for the next year.
Thanks alot,
MartinBump.
-
Help required in writing a query
hi
Consider a table (ShogenValue) with following data:
Model_Id header_id Serial_no shogen_no si_val
4329 1 40001 A0001 1
4329 1 40001 B0001 2
4329 1 50300 B0001 3
4329 1 40001 C0001 4
4329 1 50300 C0001 5
4329 1 60001 C0001 6
Select
si_val
From
ShogenValue
Where
model_id = 4329
And
header_id = 1
And
serial_no = '60001'
Is it possible to write a modified version of above query which will bring the following result:
Model_Id header_id Serial_no shogen_no si_val
4329 1 40001 A0001 1
4329 1 50300 B0001 3
4329 1 60001 C0001 6
Meaning if a record exists for a particular shogen_no (Shogen_no C0001 has value corrosponding to '60001' in above query), pick it up, if it
does not exist (Shogen_no B0001 does not have value corrosponding to '60001' in above case) then pick a record with one level less serial number ('50300' in above case) and so on.
Thanx
Regards
Omer ImtiazThis should help, although it will probably not perform. Try it and see what the plan for it is.
SELECT
FROM
shogenvalue sv,
(SELECT
max(serial_no) serial_no_max,
shogen_no
FROM
shogenvalue
WHERE
model_id = 4329
AND header_id = 1
AND serial_no <= '60001'
GROUP BY
shogen_no
) svm
WHERE
sv.serial_no = svm.serial_no_max
AND sv.shogen_no = svm.shogen_no
;HTH,
Lennert -
Help required in creating function module which reads payroll clusters.
Hi ,
We have a requirement where in we need to create a function module for reading a sequence of tables from payroll clusters. This function module does two functions:
1.Read the payroll results from one system.
2.write the payroll results to other system.
please do the needful as soon as possible.
Thanks in advance.
Regards,
Durga.hi
Refer to the below thread
Programming with Clusters for HR-Payroll
Regards
Sameer -
Help required in creating a dimension from an excel sheet
Hello all ,
We have a new requirement ,where we need to create a Dimension from an excel sheet. I tried creating it from a . csv file. But , I am not sure how to set the across, down statement ( if any) . The procedure is able to peek the data from the excel sheet. But , it says that the dimension member is not a selected member of variables. We have not created any variable yet. The transcript of the procedure is below :
remove dimension MODULE
ACCESS EXTERNAL
USE 'C:\module.csv'
DESCRIPTION FREE ,
peek only 5
read
BEGIN
construct MODULE
level MODULE_CD
label MODULE_DESC
preface "custom 5 allocate 1000,30,1"
END
end
compile dimension MODULE
Please advise
Thanks and Regards
VijayHi Vijay,
I believe you should be identifying the fields you have in your csv file, in your case MODULE_CD and MODULE_DESC:
DESCRIPTION FREE ,
MODULE_CD text 10
MODULE_DESC text 20
Can you try that to see if it makes a difference?
Regards!
Ricardo
Maybe you are looking for
-
How Can I add/change text/description in accounting view of Vendor master ?
/nxk02 --> (give vendor, company code ) then check the check box of 'Accounting info' under Company code data block --> then hit 'Enter' --> it goes to next screen. Then in this screen, click menu 'Extras' --> then press "Texts" under that menu.
-
How can I ensure newer versions of the same page are opened every time I visit
I am advised by my Uni IT screen to ensure that firefox is set to check for 'newer versions of the same page with every visit to the page'. This is to ensure proper functioning inside the University's internal tutorial program.
-
Mac has a bluish tint to it, just happened last week
Hello! My Mac is a refurb, early 2011, I got it in the September. It's always run a bit low, because it's only 4gb. But a few days ago the browsers turned a bit, well, grey. Sometimes a bluish colour. ColorSync says no problem. I need to know if I'm
-
A song I just bought won't play in my iTunes?
I've never had this problem before though some of my friends have and now it's happening to me. I just bought a song probably 15 minutes ago and whenever I click on it to play it it skips to the next song. I tried playing it in quicktime and quickt
-
Mail signature image not appearing on PC
Hi. I've been struggling getting my signature logo, sent from Apple mail, to appear to PC users in the message. It works fine with mac users as far as I know, but not for PC users. What am I doing wrong? Its a image file, but only appears as an attac