Multiple Valley Detection Query

Hello There,
I am having trouble detecting multiple valleys within a bell curve type shape (see pic). The valleys are moving horizontally and I need to detect each of their positions in real time. The other issue is that the dips increase and decrease in magnitude thus making it difficult to use the dip detect function as it keeps jumping from one to the other.
any help would be greatly appreciated,
thanks.
Attachments:
multiple valley detect.jpg ‏51 KB

Hi TriboBoy,
Have you tried setting the threshold level above your data so that the algorithm used within the Peak Detection and Display VI considers all of the valleys occurring below it?
Below is a screen shot of the resulting graph using the Peak Detection and Display VI example in Example Finder:
The blue threshold line corresponds to the valley data points being considered and has been set to a value higher than any expected data points.  
It is also worth noting that the width used should be as low as possible (limited to a value of 3) so that the maximum number of data points are considered.  
Let me know if this helps you at all.
Regards
Marshall B
Applications Engineer
National Instruments UK & Ireland

Similar Messages

  • The issue with using the multiple columns sub-query in WHERE clause

    Hi All,
    my database version is 10.2.
    the problem i am trying to deal with is that when I use multiple column sub-query in the WHERE clause of the SELECT statement, the actual row number returned from the sub-query is different from the whole statement.
    And what I found is that, whenever there is NULL in any of those columns returned from the SUB-QUERY, the outer query will just return NULL for that whole row.
    Here is an example:
    select empno, ename, job, mgr, hiredate, sal, deptno from EMP
    intersect
    select empno, ename, job,  mgr, hiredate, sal, deptno from t;
    7782     CLARK     MANAGER     7839     09-JUN-81     2450     10
    7839     KING     PRESIDENT  NULL  17-NOV-81     5000     10
    7934     MILLER     CLERK     7782     23-JAN-82     1300     10
    select * from EMP where (EMPNO, ENAME, job, MGR, HIREDATE, SAL, DEPTNO) in (
    select empno, ename, job, mgr, hiredate, sal, deptno from EMP
    intersect
    select empno, ename, job,  mgr, hiredate, sal, deptno from t);
    7782     CLARK     MANAGER     7839     09-JUN-81     2450          10     
    7934     MILLER     CLERK     7782     23-JAN-82     1300          10     If I specifically deal with the NULL situations for the columns which might return NULL, I can get the result right.
    select * from EMP where (EMPNO, ENAME, job, NVL(MGR,-1), HIREDATE, SAL, DEPTNO) in (
    select empno, ename, job, nvl(mgr,-1), hiredate, sal, deptno from EMP
    intersect
    select empno, ename, job,  nvl(mgr,-1), hiredate, sal, deptno from t);
    7782     CLARK     MANAGER     7839     09-JUN-81     2450          10     
    7839     KING     PRESIDENT  null   17-NOV-81     5000          10     
    7934     MILLER     CLERK     7782     23-JAN-82     1300          10     the problem is that, I feel this is a very lame way of handling it.
    So, I wonder or am asking if there is any better or standard way to do it?
    any help would be highly appreciated.
    Thanks

    Hi,
    As you discovered, INTERSECT treats NULL as a value, but IN does not.
    What you did with NVL is one way to handle the situation. If there was a chance that any of the columns could be NULL, then you might prefer something like this:
    select      *
    from      EMP
    where      ( EMPNO      || '~' ||
           ENAME      || '~' ||
           job           || '~' ||
           MGR           || '~' ||
           TO_CHAR (HIREDATE, 'DD-MON-YYYY HH24:MI:SS')
                    || '~' ||
           SAL           || '~' ||
           DEPTNO
         ) in (
              select  EMPNO      || '~' ||
                     ENAME      || '~' ||
                   job     || '~' ||
                   MGR     || '~' ||
                   TO_CHAR (HIREDATE, 'DD-MON-YYYY HH24:MI:SS')               
                        || '~' ||
                   SAL      || '~' ||
                   DEPTNO
              from     emp
             intersect
              select  EMPNO      || '~' ||
                     ENAME      || '~' ||
                   job     || '~' ||
                   MGR     || '~' ||
                   TO_CHAR (HIREDATE, 'DD-MON-YYYY HH24:MI:SS')               
                        || '~' ||
                   SAL      || '~' ||
                   DEPTNO
              from      t
             );This assumes that you can identify some string (I used '~') that never occurs in the strings in these tables.
    This is implicitly converting the NUMBERs. That's usually not a good thing to do. but explicitly converting them would make this even more tedious.
    You should explicitly convert any DATEs to strings, however. Depending on your default format, and your data, you might get away with implicit conversions even for DATEs, but don't bet on it.
    If you had to do this often, you might consider writing a user-defined function:
    delimited_string (empno, ename, job, mgr, hiredate, sal, deptno) would return a string like
    '7839~KING~PRESIDENT~~17-NOV-1981~5000~10'
    This will make the coding easier, but beware: it will make the execution slower.

  • IsKeyDown - Multiple key detection ?

    does anyone know of how to read two keys or check two keys are down/pressed?
    I am trying to do a game where the object can mover diagonally so i need the game to react differently if 2 cursor keys are down?
    Any ideas about the isKeyDown() function?
    The keypressed/ keyreleased function i think will only detect one at a time.
    cheers all

    Try this quick Swing App I knocked up using Sun One. It shows multiple key detection, doesn't mind simultaneous key presses.
    I wrote the code for clarity more than anything else.
    Run it, see what it does and how it reacts to the cursor keys being pressed.
    * KeyEvents.java
    * Created on 05 December 2002, 16:21
    package andy.apps.KeyEvents;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    public class KeyEvents extends javax.swing.JFrame {
        /** Creates new form KeyEvents */
        public KeyEvents() {
            initComponents();
            upPanel.registerKeyboardAction(new UpOnListener(), KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0, false), JComponent.WHEN_IN_FOCUSED_WINDOW);
            upPanel.registerKeyboardAction(new UpOffListener(), KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0, true), JComponent.WHEN_IN_FOCUSED_WINDOW);
            downPanel.registerKeyboardAction(new DownOnListener(), KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0, false), JComponent.WHEN_IN_FOCUSED_WINDOW);
            downPanel.registerKeyboardAction(new DownOffListener(), KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0, true), JComponent.WHEN_IN_FOCUSED_WINDOW);
            leftPanel.registerKeyboardAction(new LeftOnListener(), KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0, false), JComponent.WHEN_IN_FOCUSED_WINDOW);
            leftPanel.registerKeyboardAction(new LeftOffListener(), KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0, true), JComponent.WHEN_IN_FOCUSED_WINDOW);
            rightPanel.registerKeyboardAction(new RightOnListener(), KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0, false), JComponent.WHEN_IN_FOCUSED_WINDOW);
            rightPanel.registerKeyboardAction(new RightOffListener(), KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0, true), JComponent.WHEN_IN_FOCUSED_WINDOW);
        class UpOnListener implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                KeyEvents.this.upPanel.setBackground(Color.black);
        class UpOffListener implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                KeyEvents.this.upPanel.setBackground(Color.white);
        class DownOnListener implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                KeyEvents.this.downPanel.setBackground(Color.black);
        class DownOffListener implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                KeyEvents.this.downPanel.setBackground(Color.white);
        class LeftOnListener implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                KeyEvents.this.leftPanel.setBackground(Color.black);
        class LeftOffListener implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                KeyEvents.this.leftPanel.setBackground(Color.white);
        class RightOnListener implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                KeyEvents.this.rightPanel.setBackground(Color.black);
        class RightOffListener implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                KeyEvents.this.rightPanel.setBackground(Color.white);
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            upPanel = new javax.swing.JPanel();
            leftPanel = new javax.swing.JPanel();
            downPanel = new javax.swing.JPanel();
            rightPanel = new javax.swing.JPanel();
            getContentPane().setLayout(new java.awt.GridLayout(2, 2));
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            upPanel.setBorder(new javax.swing.border.TitledBorder("Up"));
            upPanel.setBackground(new java.awt.Color(255, 255, 255));
            getContentPane().add(upPanel);
            leftPanel.setBorder(new javax.swing.border.TitledBorder("Left"));
            leftPanel.setBackground(new java.awt.Color(255, 255, 255));
            getContentPane().add(leftPanel);
            downPanel.setBorder(new javax.swing.border.TitledBorder("Down"));
            downPanel.setBackground(new java.awt.Color(255, 255, 255));
            getContentPane().add(downPanel);
            rightPanel.setBorder(new javax.swing.border.TitledBorder("Right"));
            rightPanel.setToolTipText("null");
            rightPanel.setBackground(new java.awt.Color(255, 255, 255));
            getContentPane().add(rightPanel);
            pack();
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            new KeyEvents().show();
        // Variables declaration - do not modify
        private javax.swing.JPanel upPanel;
        private javax.swing.JPanel leftPanel;
        private javax.swing.JPanel rightPanel;
        private javax.swing.JPanel downPanel;
        // End of variables declaration
    }

  • Managing multiple collision detection between objects(not necessarily circles)

    Hi.
    I´d like to know if there´s any good tutorial, or if somebody knows, a way, to manage a multiple collision detection with pixel level detection, for objects, not necessarily circles, irregular objects.
    Any help?

    Yes, and what about the speeds of each object?
    I was thinking something like this:
    var  _currentObj1SpeedX = obj1.speedX
    var  _currentObj1SpeedY = obj1.speedY
    obj1.speedX = obj1.speedX - obj2.speedX
    obj1.speedY = obj1.speedY - obj2.speedY
    obj2.speedX = obj2.speedX -  _currentObj1SpeedX
    obj2.speedY = obj2.speedY -  _currentObj1SpeedY
    Is it right?

  • Why no valley detected

    Hi
    Something seemingly simple I can not get to work...
    Please see the attached VI which contains an array constant (which represents a typical set of acquired data points) on which I perform a peak/valley detection.
    I would like to find the valley(s) but no matter what 'width' is used it never finds any valleys.
    Any ideas as to why this may be or suggestions on how else to determin the valley location?
    Many thanks for your help!
    Jack
    Solved!
    Go to Solution.
    Attachments:
    Valley Detect.vi ‏14 KB

    Hi there,
    You need to wire in a value for the 'Threshold' input. This input tells the VI to ignore any valleys below the threshold value. As there are no valleys in your data set below 0, you will not detect any if you don't wire in this input.
    Should you set the threshold value to '800' you will detect one valley. If you set the threshold value to '1200', you will detect three valleys.
    Hope this helps.
    Regards,
    Dave.
    Senior Software Engineer
    www.Adansor.com

  • Peak/valley detection problem

    Hi,
    How can i detect the maximum peak to valley on the graph attached.  It is not the difference between the maximum and minimum all the whole data set that i require, I want to know the maximum value of the higher frequency peaks and valleys ignoring the small 'blips' within the data.
    The X-axis is controlled by time and the number of samples between each peak varies between data sets.  I have considered using a moving average to smooth the data but cannot do this due variation of samples between peaks.
    Using the peak/valley detection VI would work great but due to the small 'blips' in the data set a true maximum value cannot be found.
    Can anyone help?
    Tom
    Attachments:
    graph.JPG ‏20 KB

    Hi Tom,
    I have been looking into your issue in an attempt to find you a solution. My initial thoughts are that you should apply some form of smoothing to the waveform before subjecting it to the the Peak Detector sub VI to detect the amplitude of the peaks and the troughs. These amplitudes could then be subtracted form each other thereby arriving at the values you are looking for. Can I confirm that this would solve your problem.
    I have been looking into a methodology for smoothing your waveform and I found the following example which uses a moving average technique, which I think could be useful. Take a look and let me know what you think.
    Best Regards,
    Christian Hartshorne
    Applications Engineer
    National Instruments UK  
    Attachments:
    Moving_Average-1.vi ‏15 KB

  • Multiple Schema select Query problem

    Hi everyone,
    when I tried to execute a select query as following,
    select A.field1, B.field2 from S1.table1 A, S2.table2 B
    in a session bean, it gives an exception as follows
    " An illegal attempt to use multiple resources that have only one-phase capability has occurred within a global transaction"
    Can anyone pls help me in this regard.
    Thanking you
    D. Suresh Kumar

    This is the query i thought of executing
    SELECT * FROM SCH2.AP_TRANSACTION_EPS A, TRANSACTION_TYPES B WHERE C_FUND_CODE = '" + fundCode + "'AND D_TRADE_DATE = to_date('" + date + "','yyyy-mm-dd') AND A.C_TRANS_CODE = B.C_TRANS_CODE " + " AND B.C_TRANS_TYPE = '" + transType + "' ";
    where "fundCode", "date","transType" are java variables.
    The error message is
    [8/1/03 12:38:49:688 IST] 491a6a5 TransactionIm E WTRN0062E: An illegal attempt to use multiple resources that have only one-phase capability has occurred within a global transaction.
    [8/1/03 12:38:49:750 IST] 491a6a5 ConnectO A CONM6014I: Received exception (IllegalStateException) in method (enlist). Issuing new exception (IllegalTransactionStateException). The original exception's stack trace was: java.lang.IllegalStateException
    Thanking you

  • Infoset resulting multiple results at query level

    Hi,
    I have joined 1 DSO and 1 Infocube in Infoset.. Mapped Plant, Material and Batch
    DSO
    Plant     Material      Batch      Caldate         Qty
    P1          M1          B101          01/02/2014     1000
    P2          M2          B102          05/02/2014     2000
    Infocube
    Plant          Material         Batch     Caldate               %
    P1               M1               B101          02/02/2014          20
    P1               M1               B101          05/01/2014          20
    P2               M2               B102          07/02/2014           15
    I'm considering date only on DSO and ignoring Infocube date. When I execute the report for the month of February, report output is as follows.
    Plant   Material     Batch     DSODate         Qty           %
    P1          M1               B101     01/02/2014          1000          40 (Summing up with January Date)
    P2          M2               B102     05/02/2014          2000          15
    I want data % value to be 20%.
    Is there any possibility to change at query level or join level.
    If we have one line item, data is correct but not the case with multiple line items.
    Kindly do the needful!
    Thanks
    SS

    Hi,
    When you join the two infoproviders in the infoset ignoring infocube date, you are creating as many records for each record in DSO. That means for the first record the infoset creates :
    Plant     Material      Batch      Caldate         Qty     %
    P1          M1          B101          01/02/2014     1000  20   (for first row in infocube)
    P1          M1          B101          01/02/2014     1000   20  (for second row in infocube)
    I also think same as Anshu, you have all the common characteristics, you can as well use a multiprovider.
    regards
    Yasemin...

  • Multiple selection in Query Panel. Operator Does not equal generates error.

    Hi,
    I'm using Jdeveloper 11.1.1.4 and creating Oracle Fusion Web Application with ADF Business Components.
    I want to use multiple selection on LOV in ADF Query Panel with Table, but I get the following error
    when I use operator "Does not equal":
    Error: Unsupported model type.
    SelectMany does not support a model of type class java.lang.Integer.
    A simple example:
    Schema: HR
    Generate default Business Components for tables Departments and Employees.
    Model:
    Create List of Values for EmployeesView(DepartmentId)
    List Data Source: DepartmentsView1
    List Attribute: DepartmentId
    Display Attributes: DepartmentName (UI Hints)
    Create View Criteria EmployeesByDepartmentVC for EmployeesView
    Criteria Item:
    Attribute: DepartmentId
    Operator: Equals
    Operand: Literal
    Select "Support Multiple Value Selection" (UI Hints)
    ViewController:
    Create blank JSF Page: showEmployees.jspx
    Drag EmployeesByDepartmentVC from Data Controls to showEmployees.jspx
    Create Query=>ADF Query Panel with Table
    Run application.
    Press Advanced button.
    Select operator "Does not equal" and department names "Administration;Marketing"
    Press Search
    Error: Unsupported model type.
    SelectMany does not support a model of type class java.lang.Integer.
    Note: it works fine with operator "Equals"
    Best,
    Kees.

    Hi,
    I was reading:
    http://www.oracle.com/technetwork/developer-tools/jdev/jdev-11gr2-nf-404365.html#bugs_fixed_in_11.1.2.2.0
    Bugs Fixed in 11.1.2.2.0
    Bug.No. 13508184
    unsupported model type error thrown for multi select view criteria
    I have tested the use case described in this thread with JDeveloper 11.1.2.2.0 but I still get the same error.
    when I use operator "Does not equal":
    Error: Unsupported model type.
    SelectMany does not support a model of type class java.lang.Integer.
    Is there anybody who can tell me more about this bug fix?
    Thanks,
    Kees.

  • Multiple conditions in Query doesn't work

    Hi all,
    I've made a query pointing on a Multiprovider wich 's made of two main dimension ( multiple infoproviders ) :
    contract and pricing and on the other hand  Sales and Revenues.
    In my Query, one condition's concerned by a contract & pricing key figures ( Number of pricing condition > 0 ), and another one is about a Minimum Turnover Sales & Revenues key Figures restriction( by a prompt ).
    This doesn't match, Some rows are missing, and while a condition is active , the other one can't be..
    If any one meet this kind of problem before ?
    Thanks and sorry for my bad english..

    Hi,
    I already try to create another key figure wich made like this :
    Number of condition * Turnover
    and made a condition on this result.
    But the main problem is  if the contract doesn't have Turnover, it will not shown the rows with condition ..( the condition is on the single value 'number of document ) and if I put anotehr condition with number of condition > 0, it still doesn't work..
    thanks for help.

  • Multiple exclusion of query filter values

    Hello,
    We are trying to find a way to do a multiple selection of non consecutive values (codes) to be excluded for further navigation, but either in Excel or Web reports it is only possible to do selections for exclusion one by one and when there are many non consecutive values, it is very time consuming and subject to errors.
    Example: for listing customers that buy Material 1 but don´t buy Material 2, filter value 2 for Material, display all customers, then perform an exclusion of all the customers displayed, could be many, then the need of the multiple exclusion, and then do a Material selection for Material 1.
    We appreciate any help on this subject.
    Regards
    Gustavo Sanson

    Hi Gustavo,
    I think you can use precalculated value sets for this.
    I would leverage your example.
    You would have a base query 'X' which displays all customers for which material2 ws sold foar a certain period.
    This report will run in the background and fill the variable which is of precalculated value set type.
    For this you will have to use broadcasting.
    Create a broadcast setting for this base query X, name it customers for material 2.
    Configure the broadcast setting to refer to characteristic customer for getting the multiple values.
    Create a variable for customers in your actual quey and select its type as precalulated variable set.
    Now when you run the actual query, you will see the variable in the variable popup and if you choose F4 value help, you will see your braodcast setting name, which is actually the precalculated value set.
    Use the operator to exclude.
    One advantage with precalculated value set is , you can dynamically generate this list of multiple values at run time and for every period. You can schedule the broadcast setting to calculate the value set at whatever frequency you desire.
    Check the link below for more explanation on precalculated value set.
    http://help.sap.com/saphelp_nw70/helpdata/EN/c9/1a9341d38aa209e10000000a155106/frameset.htm
    Regards,
    Sunmit.

  • BW Tree Hierarchy-multiple selection for query possible?

    Hello,
    I have a question in regards to BW Tree Hierarchies and its usage in Bex Reporting:
    Is it possible to select multible Tree Hierarchy (based on the same characteristic) when executing a query in Bex Analyzer. If yes, how?
    I tried to configure this by making use of a hierarchy variable on the characteristics, but it does only allow me to select one hierarchy.
    Thanks for your help,
    Elisabeth

    Elisabeth,
    Your query can only assign one hierarchy per characteristic.
    If you need multiple ones - I'd suggest you make a query per hierarchy and you can user Query Views in the WAD to let the user select the View (i.e.. the Hierarchy) they wise.
    Regards
    Gill

  • Peaks and valleys detection of a zig-zag shape waveform

    Hi,
    I have 2 waveforms coming in and I would like to detect the peaks and valleys(with the location, or ) and write them to a spreadsheet file. 
    In a pattern like this
    peak #1(waveform 1)            peak #1(waveform 2)                  Location of peak#1(waveform 1)              Location of peak #1(waveform 2)   
    valley #1(waveform 1)           valley #1(waveform 2)                Location of valley#1(waveform 1)             Locationo of valley#1(waveform 2)
    peak #2(waveform 1)            peak #2(waveform 2)                  Location of peak#2(waveform 1)              Location of peak #2(waveform 2)
    valley #2(waveform 1)           valley#2(waveform 2)                  Location of valley#2(waveform 1)            Location of valley #2(waveform 2)
      The waveforms come in with varing heights, kind of like a wiggling zig zag shape.  Sometimes the peaks/valleys are very smooth and kind of hard to differentiate from the others. 
    Thanks.

    If you search the forums for peak detect, you will find a number of hits.  Also, here is a recent thread discussin peak detection without setting a pulse width.
    Basically, you want to use the peak detection.vi located in Signal Processing > Signal Operation.  That will find your peaks and valleys.
    In order to put all of this into Excel/Spreadsheet (do you have / want to use the Excel Toolkit or just the Write to Spreadsheet.vi?), you will need to  feed all of your points into a build array and a shift register and then when you are done aquiring data, feed that into the Write to spreadsheet.vi or to a vi for excel.
    The formating will depend on how you feed the data into your array, ie wave 1, location 1 or wave 1 , wave 2, etc
    Kenny
    Kenny

  • Multiple or Single Query?

    I am trying building a ConstituencyMap of electoral
    Constituencies each of which a couple of polling stations. I want
    to output information containing the Name and Region of each
    constituency and also a running total of the votes from each
    polling station in that constituency until all polling stations in
    that constituency have reported their results. Further more I will
    use a query to find out which party won and change the color of the
    cell to the parties assigned color.
    My question is how do I get all this information in a single
    cell. I do not know if I can use multiple query values in the same
    logic. For example, my code to show the constituency name and
    region is as attached. Being a novice in databases, I would rather
    use multiple queries and try to add the results to the cell, but I
    do not know if this is possible, I think a single query drawing
    information from my multiple table would be the way to go, but this
    would be a complex query.
    I will appreciate any insight into this. Thanks

    As well as Dan's suggestion for "Teach Yourself SQL in 10
    Minutes" by
    Ben Forta.
    You can reference multiple queries. You just have to
    reference the
    record set data structure yourself, rather then relying on a
    shortcut
    such as <cfoutput query="aQuery">
    A fully qualified record set reference is
    queryName.columnName[row] OR
    queryName['columnName'][row].
    I.E.
    <cfquery name="aQry".../>
    <cfquery name="bQry".../>
    <cfoutput>
    #aQry.aColumn[1]# <---> #bQry['bColumn][2]
    </cfoutput>

  • Complex Multiple Table Sum Query

    Here's a doozy for you. It is a pretty large query (by my standards, anyway) that is pulling data from multiple tables to fill a GridView in ASP.NET. The query is independent of .NET, so I think this is the right place for this post.
    Summary: Trying to get all of the data from the main table and the children tables, in addition to summing up the matching values from two children tables.
    The main table is RA_INVOICES. Some of the children tables are RA_USERS, RA_STATUS, etc. The two tables I am having issues with are RA_SYSTEMINVOICES and RA_ADJUSTMENTINVOICES. The key is MAN_INVOICE_NUM. If there are no rows in either the System or Adjustment tables include MAN_INVOICE_NUM, I get nothing back from the query. Here is my current query (I removed any fields that are not joined in some way, except for the key):
    SELECT RA_INVOICES.MAN_INVOICE_NUM, RA_CURRENCIES.CURRENCY, RA_STATUS.STATUS, RA_REGIONS.REGION, RA_REASONS.REASON, RA_USERS.EMAIL AS EXPR5, RA_USERS_2.EMAIL AS EXPR4, RA_USERS_1.EMAIL, NVL(SUM(RA_SYSTEMINVOICES.SYS_INVOICE_AMT), 0) AS EXPR2, NVL(SUM(RA_ADJUSTMENTINVOICES.ADJ_INVOICE_AMT), 0) AS EXPR3
    FROM RA_INVOICES
    INNER JOIN RA_CURRENCIES ON RA_INVOICES.CURR_ID = RA_CURRENCIES.CURR_ID
    INNER JOIN RA_REASONS ON RA_INVOICES.REASON_ID = RA_REASONS.REASON_ID
    INNER JOIN RA_STATUS ON RA_INVOICES.STATUS_ID = RA_STATUS.STATUS_ID
    INNER JOIN RA_REGIONS ON RA_INVOICES.USER_GROUP_ID = A_REGIONS.REGION_ID
    INNER JOIN RA_USERS ON RA_INVOICES.CC_EMAIL_ID = RA_USERS.USER_ID
    INNER JOIN RA_USERS RA_USERS_1 ON RA_INVOICES.CCM_EMAIL_ID = RA_USERS_1.USER_ID
    INNER JOIN RA_USERS RA_USERS_2 ON RA_INVOICES.DCM_EMAIL_ID = RA_USERS_2.USER_ID
    INNER JOIN RA_SYSTEMINVOICES ON RA_INVOICES.MAN_INVOICE_NUM = RA_SYSTEMINVOICES.MAN_INVOICE_NUM
    INNER JOIN RA_ADJUSTMENTINVOICES ON RA_INVOICES.MAN_INVOICE_NUM = RA_ADJUSTMENTINVOICES.MAN_INVOICE_NUM
    GROUP BY RA_INVOICES.MAN_INVOICE_NUM, RA_CURRENCIES.CURRENCY,
    RA_STATUS.STATUS, RA_REGIONS.REGION, RA_REASONS.REASON, RA_USERS.EMAIL, RA_USERS_2.EMAIL, RA_USERS_1.EMAIL
    Optionally I need to add the following:
    HAVING (RA_INVOICES.MAN_INVOICE_NUM = 'xxxxxxxxxx')
    So... where there are values in both of the tables (System and Adjustment) for MAN_INVOICE_NUM, I get results. Otherwise, if there are no tuples exist in one or both of those tables for MAN_INVOICE_NUM, I get nothing at all.
    Sorry this is so complex. Thought I'd give you guys a good challenge. ;-)

    OK fellas (and ladies, if you happen to populate an Oracle board!)... one last question:
    The solution offered worked perfectly. I would like to see if I can accomplish one last thing with this query, and that is to do some inline math operation on the results of the query. Basically, I need to take RA_INVOICES.MAN_INVOICE_NUM and subtract SUM(NVL(RA_SYSTEMINVOICES.SYS_INVOICE_AMT, 0)) AS SYSTOTAL and SUM(NVL(RA_ADJUSTMENTINVOICES.ADJ_INVOICE_AMT, 0)) AS ADJTOTAL from it.
    I tried MAN_INVOICE_NUM - SYSTOTAL - ADJTOTAL AS TOTAL, but it returned "Error Message: ORA-00904: SYSTOTAL: invalid identifier."
    So I changed the math to say MAN_INVOICE_NUM - SUM(NVL(RA_SYSTEMINVOICES.SYS_INVOICE_AMT, 0)) - SUM(NVL(RA_ADJUSTMENTINVOICES.ADJ_INVOICE_AMT, 0)), but I am afraid of the performance implications this has... it already read the value, why should I make it do it all over again? This query will eventuall be pulling a BUNCH of rows... a year from now we'll be in the tens of thousands if the user does a global query (most of the time this query will have a WHERE statement limiting the results). Just trying to make this query as efficient as possible.
    The other alternative is to make this a SPROC. I'm clueless on SPROCS right now, but if I could gain a performance advantage using a SPROC, I'd rather do that.
    Thanks in advance for your help!

Maybe you are looking for