Management when the percentage getting null values

Hi all

I'm writing a query that gives me the account, the total number of transactions, the total number of transactions that are being matched (from the same table) and finally a percentage.

After the documentation and brushing my knowledge of sql, this is the query.

Select A.ACCOUNT_ID,A.TOTAL_TXN,B.TOTAL_MATCHED,(B.TOTAL_MATCHED/A.TOTAL_TXN) * 100 AS PERCENTAGE

FROM (select account_id, count (*) bdr_transaction TOTAL_TXN

where

value_date = January 9, 15 '

Account_id group) has

LEFT JOIN

(select account_id, count (*) bdr_transaction TOTAL_MATCHED where)

value_date = January 9, 15 ' and

type in (1,2)

Account_id group) B

ON A.ACCOUNT_ID = B.ACCOUNT_ID;

This query gives me almost the expected output (if it takes too much time), but when the result of the B.TOTAL_MATCHED column is null the percentage is also set to null.

Is there a way or a workaround to handle this?

There might be another way more quick/clean, to do so.

Thank you

TK

Select ACCOUNT_ID, TOTAL_TXN, TOTAL_MATCHED, (TOTAL_MATCHED / TOTAL_TXN) * 100 AS PERCENTAGE

de)

Select ACCOUNT_ID, count (case when type (1, 2) then 1 end) TOTAL_MATCHED, count (*) TOTAL_TXN

of BDR_TRANSACTION

where VALUE_DATE = January 9, 15 '

ACCOUNT_ID group

)

Tags: Database

Similar Questions

  • Change the conditions when the parameter is null

    I am building an Apex application where the client will fill out a form to get the data. I want to know if there is a way to modify the WHERE clause based on the selections of the customer allows shaped.

    Here is the scenerio:

    The user form has 3 fields, which should all be able to be null to return all results. We will call them P10_A, P10_B and P10_C

    If the user selects a value for all three, where clause is:

    where column_a =: P10_A
    and column_b =: P10_B
    and column_c =: P10_C.

    It works correctly if the user chooses a value for everyone, but if they do not choose a value for P10_B, I need my query to edit the where clause is

    where column_a =: P10_A
    and column_c =: P10_C.

    I have not found a way to do this, so I put my question to you. Is it possible to selectively include certain parts of the place where clause based on the presence of null values?

    Hello

    You must change your where clause to something like this:

    where (column_a = :P10_A OR :P10_A IS NULL)
    and (column_b = :P10_B OR :P10_B IS NULL)
    and ( column_c = :P10_C OR :P10_C IS NULL)
    

    I hope this helps!

    --
    Paulo Vale
    http://Apex-notes.blogspot.com

  • When I insert an image in the body of my email, it is replaced with an attachment when the recipient gets (also using OE).

    I use outlook express 6 on windows xp pro.

    When I Insert an image in the body of my email, it is replaced with an attachment when the recipient gets (also using OE).
    I did use the option of fixing , I used to Insert.  The reverse also occurs.  When someone using OE sends me an email with
    a peak inside the body of the email, it appears in the box and not in the body of the email. This happens only when they concern the
    my program.  Others using OE does this experience between them.

    My mail sending format is HTML and in its settings, I checked "send pictures with messages. In addition, in the tools of internet explorer, advanced, multimedia.
    I 'send photos' checked also, in the email window, under 'format', ' Rich Text (HTML) "checked.

    I have recently reinstalled cleanly win xp to address a system idle in general.  All updates are in place and tested it with antivirus and anti-malware programs.

    That is what it is?

    [Transferred from Internet Explorer]

    Original title: outlook express

    Tools | Options | Read. Read all messages in plain text it is checked? This it will make become an attachment.

  • Looking to run a script when the form gets focus

    Hello all flexers out there...
    I have an application that uses a tab navigator control that is embedded inside a tab navigator control. Basically, it gives me two rows of browsers tab which is really cool. My problem, well my flex related question, is that I want to trigger a code when I select one of the tabs in the browser built-in tab control.

    I tried to use the indicator of activation in the header tag but who does not have the first time the form is opened, more it will always fire when the browser loses focus. I tried the indicator initialization, but this event only fires when the form is created first and before all the data is passed to the form. The creationComplete triggers once and it was after that the form is created the first time, but before that any data sent to it.

    Grrr... I need to initialize a few combo boxes, but I only want to run the Action Script when the form gets the focus and I need to have the data available before running the script. Any ideas?

    Thanks in advance for the help!

    Have an ordinary day...
    KomputerMan ~ |  :-)

    Thanks for the tip of Tracy, but the change event fired off so many times, I stop counting until I killed my debugging session.

    After reviewing all the events in the model itself, I finally started to recede in the code. It turned out that the show in the canvas that called the 2nd tab navigator works best.

    There is one thing about Flex that makes me just batty. The way in which things are called and the number of times where things sometimes called in Flex doesn't make much sense at all. I think we should clean up the sequence of events in Adobe Flex! I keep seeing all kinds of events fire off several times and I can't understand why. Well the show solved this problem for me!

    Have an ordinary day...
    KomputerMan ~ |  :-)

  • Get Null value online by using the reference line.

    Hi guys,.

    I get the null value of the line everytime I use the reference line. Here is my code.

    String rowReference = pageContext.getParameter (OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);

    Line OARow = (OARow) am.findRowByRef (rowReference);

    System.out.println ("row" + Row);

    If (line! = null)

    {

    System.out.println ("Surfing");

    Object succObj = row.getAttribute ("INTERFACE_HEADER_ID");

    String succStr = succObj.toString ();

    throw new OAException ("" + succStr, OAException.INFORMATION);

    }

    Thank you

    I found workaround to get a current line like «($OA.» CURRENT. Id_interface)"as REFERENCE of the LINE does not work. I'm passing the parameter to my Textinputbean in the application of process method and by capturing the current values in the process of request form

    Treat the claim code

    Hashtable params = new Hashtable (1);

    params.put ("param1", pageName);

    Hashtable paramsWithBinds = new Hashtable (1);

    paramsWithBinds.put ("param2", new OADataBoundValueFireActionURL (oamessage, "{$INTERFACE_HEADER_ID}" ""));

    updateIcon.setFireActionForSubmit ("updateRecord", params, paramsWithBinds, false, false);

    Process form Code

    If ('updateRecord".equals (pageContext.getParameter (OAWebBeanConstants.EVENT_PARAM)))

    {

    System.out.println ("after" m "+ pageContext.getParameter ("param2")); / / give you current value as $OA. CURRENT. ID_INTERFACE

    }

  • Popups annoying on second Manager when the display manager is running

    Hello

    I have a Dell U2414H monitor HDMI port and an old 17 "Sony SDM S73 secondary monitor on VGA connection.  When the display manager is running, I get a popup on the Sony monitor that says "auto" , then "ADC success" about every minute.

    The popup appears only if the display manager is running.

    I tried auto and manual modes in the display manager but still no problem.

    Any suggestions?

    • Packard Bell iMedia S2885 - Intel HD 4600 Graphics
    • Updates Windows automatic/8.1.
    • Display Manager 1.21.0.150.

    Thank you

    The Sony is likely to be a monitor pre-MCCS, that maps a read status command a VGA setting automatic function.

    I don't know if it will completely eliminate the problem, but if you're comfortable editing the Windows registry try to add the "SkipCIcheck" value to HKEY_CURRENT_USER\Software\EnTech\DDM and it 1 (dword). Then restart the display manager Dell and see if things have improved.

  • Importing data into Tables - by using the Import Wizard - Null values

    Hi all

    I would like to use the data import wizard to import data into existing intermediate tables, that are already filled with data.

    However, when you import my CSV file, while the import completes without error, all of the empty cells are filled with (null)"- is anyway to prevent this?

    For example, ColumnA contains data for lines 1-11 and 12-14 15-30 but row are empty, when you download the wizard of column rows 12-14 are wired populated "(null)". I would like to prevent this

    Thanks a lot for your help

    ROss

    Yes, it shows a (null), but there is nothing there.
    If you go to sqlplus and do a query on the table, it shows a white.

    If you want to get rid of the (null), then go to Tools - Preferences - Database - Advanced - display Null value like: remove the (null)
    You can even display a different background color when it is null if you wish.

    Michael

  • Running query when the display changes of value of box

    Hello everyone, I have a little problem. In my form, I have 2 rematch, the first will contain only a display element that is filled with a lov when a user presses a button. The second poster datablock a list of items that should be queried depends on the value of the LOV above. What I thought I could do are on a trigger after change of the displayed element is:

    go_block ('block_name');
    do_key ('execute_query');

    However, I am told that I can't do these in a trigger of change, someone would have suggestions on how to get what I'm looking for. I should maybe create my own trigger somehow or is their most simple way.

    Thank you










    I have 1 datablock consisting of 1 single view point which is filled when a user presses a button that displays in turn a LOV for the user to select a value of. When the value of the displayed item changes,

    Published by: 786733 on August 24, 2010 01:28

    Hello

    Try to use the KEY-LISTVAL trigger in the element where the lov is attached. Something like that...

    LIST_VALUES;
    IF :item_name IS NOT NULL THEN  -- Here item_name is where the LOV will return value.
      GO_BLOCK('block_name');
      EXECUTE_QUERY;
    END IF;
    

    -Clément

  • Case when the field IS NULL then... end

    Hello world

    (a) If a field is null, display a message.

    (b) the field shows beak null. application for admin to make outer joins between the tables.

    (c) I have 9 rows, 3 have NULL values,
    So, I want to show a literal message on 3 rows.

    problem is that the message shows on all the 9 lines.


    now:
    ====
    I could have adopted an approach very unorthodox at this request, please bear with me.
    I work for a college and am interested in students who did not encourage the "" in the last six months
    for this semester, beak. they repeat the year.

    200830 M1 generally promote to 200920 M2 (m1 attribute replaced by m2)

    M1 - 1 year 200830 = winter
    M2 - 2nd year 200920 = fall (200910 is special and not interested by this semester for this request)


    I want to run a query to search for the students who did not encourage.

    hand the sql would be:

    SELECT st1.id
    st1.name
    sa1.academic_period
    sa1.student_attribute
    sa2.academic_period
    sa2.student_attribute
    Student st1
    INNER JOIN student_attribute sa1
    ON st1.person_uid = sa1.person_uid
    AND sa1.academic_period = '200830'
    AND sa1.student_attribute = 'M1 '.
    LEFT JOIN student_attribute sa2
    ON st1.person_uid = sa2.person_uid
    AND sa2.academic_period = '200920'
    AND sa2.student_attribute = 'M2 '.
    where st1.academic_period = '200830'
    and sa2.student_attribute is null
    ORDER BY st1.name;


    ===========

    taking the hardcoded values and putting a LEFT JOIN simplified in a display/custom folder
    and then by creating the conditions in discoverer, essentially behaved as an EQUI-join and do not show the
    null lines

    =============

    I compare a "slice" of data "another" data 200920/m2 200830/m1

    so I begged the admin as an experiment to "clone" the desired table as 2 views and external to join them
    Discover the left join to student attribute #1 to
    attribute of student views #2


    and using the technique to deceive the discoverer of a LEFT JOIN in: student_attribute is null or student_attribute is null

    I got what I wanted - pupils with NULL values in attribut2, beak. they did not encourage

    ==============

    so now I wanted to create a new discoverer in copying the above query query and adding new 'logic ':

    In this new queyr am interested if the student extensible query determined #1
    have been coded by the staff in order to take into account that they repeat:
    M1 200830 as:
    M1 200920 (their bump up current semester with the same code attribute)

    so I thought... hmmmmm... I also have the ordinary table: attribute of the student
    now watch a 3rd data slice: 200920 m1


    Discover the left join to student attribute #1 to
    attribute of student views #2

    left to join University
    attribute of student views #1

    I access the beak ordinary table this pre-established join :

    University to join
    student table attribute

    ====================
    so my 2nd query uses:
    -Discover the condition attribute #1 student: 200830/m1
    -Discover the condition attribute #2 students: 200920/m2
    -University studies
    -condition of table student attribute: 200920 / * m1 *.


    and to maintain the table: attribute of student for M1 200920
    to see if records created the current semester for Extensible students staff


    This query has worked, got the 9 lines, of which 3 had to be coded to 200920/m1
    For lines 3 nulls, want to create a calc that would show this literal:

    "needs 200920 m1 folder.

    the problem is the literal is printing even on rows that have a value in the fields from the table, it's the calc:


    BOX WHEN (period DMC_Student_Att2.Academic IS NULL) THEN

    "NEEDS" | "'-> ' |: Parm_AcademicPeriod_Current |" " ' || : Parm_StudentAttribute_Prev

    END


    Any advice that might work with this unorthodox approach would be greatly appreciated,
    Advice to the other approaches would be also appreciated, tx, sandra

    Hi, Sandra
    When you work with outer joins, with that I conclude with a double whammy an OR statement allows me to make some incredible manipulations.

    For example, if you have a folder that the master joined the detail folder B with an outer join on B you get records from one if they exist in B or no - no?

    It doesn't have to be the case, you're just limit your way of thinking. It must get off the beaten and tell ourselves, if I could force discoverer to create a subquery with the NULL filter outside, I could find these B that don't have any corresponding entry in B, or I could find who had only the entries in the two.

    Let's say there's a STUDENTID b, using a normal like condition: B.STUDENTID IS NULL will not work because of the outer join. But if you create a Boolean condition, like this:

    B.STUDENTID IS NULL or B.STUDENTID IS NULL you will see amazing results.

    This tip can help.

    In which your question, taking the knowledge above, I was wondering what would happen if you did:

    BOX WHEN (period DMC_Student_Att2.Academic IS NULL) OR (period DMC_Student_Att2.Academic IS NULL) THEN

    "NEEDS" | "'--> ' |: Parm_AcademicPeriod_Current |" " ' || : Parm_StudentAttribute_Prev

    I am not sure it will work. If it isn't then you need create 2 worksheets, one containing the students who made the promotion and the other for those who do not. You need the conditions to make this work, one like this:

    * (Period of DMC_Student_Att2.Academic IS NOT NULL) OR (DMC_Student_Att2.Academic period IS NOT NULL) *.

    and other like this: * (DMC_Student_Att2.Academic period IS NULL) OR (DMC_Student_Att2.Academic period IS NULL) *.

    Best wishes
    Michael

  • Detect when the field gets the visibility on the screen

    Hi gurus

    I extended a BitmapField that when it is displayed on the screen is running a Thread internally in order to upload an image from a web server and then display it on the BitmapField. During the download of the Thread, it shows a dummy Bitmap.

    I am now the list 15 images on a screen in a VerticalFieldManager, and as soon as the application starts, 15 thread starts to download each image.

    When I run the application on the Simulator, with WiFi, all the images always get downloaded without problem all the time but when I run it on the device, sometimes the images are downloaded and sometimes some of them are not downloaded due to a "General socket error" (it is said the message of the Exception).

    This behavior is kind of random, I wonder that it is a restriction on the number of requests that a device can perform the carrier (by BIS) at the same time or something like that. Sometimes 15 images are always downloaded without problem.

    Now, the important thing, to circumvent the problem, what I'm trying to do is:

    Even if I add 15 images on the screen, only 3 images are visible at the same time (on the Curve 8520 in which I am testing now) so I'll try to find a way that only these 3 images run the download thread and when the user makes a scrolling to the bottom of the screen, the fields earning "visibility" on the screen start to run in their own thread too but didn't find a way to detect if a field of on the screen, and not only in the manager gains visibility of

    I try with:

    protected void onVisibilityChange(boolean visible)
    

    But as soon as the Manager is loaded on the screen, all fields run this even if events are now actually visible on the screen (they are in the lower part of the Manager)

    Is it possible to know when a field get visible only on the actual device screen and not on the virtual screen?

    Thank you!

    This might not work on all devices, but the first invocation of painting of the field is a good indicator.

    In my experience, the interface user of BlackBerry is very economical - everything that is not on the screen isn't painted. well, something that used to be on the screen and got a scroll being on could still be there in an internal buffer, so his painting could not called at all when it scrolls- but the first seems to be a pretty reliable indication.

  • App updates and the launch of Creative Cloud Desktop Manager when the connection

    Will I be notified on updates of Adobe Applications, if I do not allow the launch of Creative Cloud Desktop Manager when connecting?

    Hello

    If you uncheck the launch at login checkbox for cloud creative launch at startup. You can still get the notification of update by launching the cloud creative app manually. You will not get automatic notification if creative cloud desktop application does not run and the display notification check box is not checked.

  • Throw the records with null values columns

    Hi all.

    Anyone know how to dispose of records containing null column values?

    In the target table, I have the set Null option? with "N"... then the process sqlldr load some records. I need to load all of this without the records with null column values. by result, if the field X is null then load the file.

    Kind regards.

    Published by: ASzo on 05/06/2013 12:37

    Published by: ASzo on 05/06/2013 12:38

    Published by: ASzo on 05/06/2013 12:42

    load data
    INFILE...
    in the table...
    When x! = ''
    fields completed by...
    (x ...)

  • Add filter slot table form to show the lines with null values

    Hello

    I have a tabular presentation where we need to add a filter with two values (selection list) so that if one of the columns in a table (column1) is zero, then I need to display all records where column1 is null.

    I was wondering how do I put this in the Source of tabular forms where condition. This filter has only two values,

    All the
    NULL for the error

    So when the user selects all, then all the records in the table are shown
    If the user selects 'Value Null in error', while the records where Column1 is null will be shown

    For example
     column1        column2
                           A
                           B
          1               C
          3               D
     
    If the user selects, then

    all four files will show up. Else, only the first and the second will be returned.

    Thank you

    Hi, Ryan.

    Try a static LOV like this

    STATIC2:;,--- All ---;--- All ---
    

    and a Where clause, like this

    where column1 is null or :p1_filter like '%%'
    

    Jeff

  • Fill with the previous 'not null' value ' Null' known values

    Hi all

    I have the following requirement to fill in missing values (null values) with the "Not null" values known previously available.

    Source of the example:

    Emp_Id Start_Dt LOC Comm Grade

    A101

    01/01/2013

    NJ4000B

    A101

    15/03/2013

    CA4800

    A101

    15/05/2013

    3500C

    A101

    25/07/2013

    2500

    A101

    20/12/2013

    NY5800A

    A101

    14/02/2013

    5000

    A101

    20/05/2014

    DC6000A

    A101

    03/06/2014

    3600C

    A102

    24/05/2013

    THE5000A

    A102

    15/12/20134300

    Expected results values in columns LOC and grades:

    Emp_Id Start_Dt LOC Comm Grade
    A101

    01/01/2013

    NJ4000BA101

    15/03/2013

    CA4800BA101

    15/05/2013

    CA3500CA101

    25/07/2013

    CA2500CA101

    20/12/2013

    NY5800AA101

    14/02/2013

    NY5000AA101

    20/05/2014

    DC6000AA101

    03/06/2014

    DC3600CA102

    24/05/2013

    THE5000AA102

    15/12/2013

    THE4300A

    Any suggestions would be helpful.

    Kind regards

    Arun

    Also, I think that this is a case of analytics. Last_value is perhaps the most appropriate function for the given task:

    Select emp_id

    start_dt

    last_value(loc ignore nulls) over (partition by emp_id arrested by start_dt) loc

    comm

    last_value(grade ignore nulls) about category (partition by emp_id arrested by start_dt)

    t

  • CF10 active metrics logging but getting NULL values instead

    In an effort to troublshoot issues I'm having I activated the connection CFADMIN settings but this is what I see in the metrics.log file.  What gives?

    "Information","scheduler-1","11/13/13","15:59:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1737648152 Total memory: 2117206016 Active Sessions: 0"
    "Information","scheduler-1","11/13/13","16:00:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1565060456 Total memory: 2117206016 Active Sessions: 0"
    "Information","scheduler-3","11/13/13","16:01:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1634382744 Total memory: 2089222144 Active Sessions: 0"
    "Information","scheduler-2","11/13/13","16:02:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1532903104 Total memory: 2089222144 Active Sessions: 0"
    "Information","scheduler-0","11/13/13","16:03:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1371544704 Total memory: 2089222144 Active Sessions: 0"
    "Information","scheduler-2","11/13/13","16:04:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1193930792 Total memory: 2089222144 Active Sessions: 0"
    "Information","scheduler-3","11/13/13","16:05:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1749200240 Total memory: 2117664768 Active Sessions: 0"
    "Information","scheduler-3","11/13/13","16:06:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1614707664 Total memory: 2117664768 Active Sessions: 0"
    "Information","scheduler-2","11/13/13","16:07:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1485357392 Total memory: 2117664768 Active Sessions: 0"
    

    I found the answer here: ColdFusion 11 settings log NULL values. Chris Tierney

    Change the connector port in CFIDE (just underneath where you check "Enable logging of measures" to the one defined as the port of the AJP connector in server.xml - 8012 often.)  You need to restart coldfusion.

    Several ways to check a second time, I used

    grep - ir 'port connector' / opt/coldfusion10 /.

Maybe you are looking for

  • Equium A210 - after that set BIOS to update the DVD player has stopped working

    Hi, since I have recently updated my BIOS, my DVD drive has stopped working on my Equium A210-1AS with Vista 32 bit. I tried the program fixme Microsoft who does not work, upper and lower register isn't here ether in regedit.Someone at - it solutions

  • How can I find the toolbar if it is not displayed on my homepage?

    I have new windows, and when I downloaded firefox it came not at the top of the page there before. I'm looking for the file, edit, options, tools, buttons in the history.

  • Satellite A200 - Question on RAM and HARD disk partitions

    Maybe it's in the wrong section... I do not know. I've never owned an OEM operating system and I do not understand why the HARD disk is partitioned, 90, 2, 90 (who thought of that?). The thing is that I have to format and partition differently (since

  • Windows8 Y580 update

    Basically, he tries to update but it can not, happens about 15% on the configuration of new updates and it fails and reverts the changes. Any help is very appreciated If you download some things and install myself (or along those lines) I know not ho

  • I 200918 error when you try to save a task DAQmx

    I have a Labview application 7.0 that creates and registers a task DAQmx (DAQmx version 8.0).  I can create a new task, but when I try to save the task I have Labview 200918 internal error. So far, this has worked very well on several machines but re