How to change the NULL value to 0?

Hello

I have a formula as below to get the PRODSUPP % against total LICENSE.
Formula 1
(sum (case when ECA_SALES_CREDITS_MV.)) ACCOUNT_CODE = "PRODSUPP", AND THEN ECA_SALES_CREDITS_MV. TRANSACTION_AMOUNT_SUM 0 otherwise fine)
/ sum (case when ECA_SALES_CREDITS_MV.) ACCOUNT_CODE = 'LICENSE' THEN ECA_SALES_CREDITS_MV. TRANSACTION_AMOUNT_SUM else 0 end)) * 100

The problem with the formula 1, is that when in the formula returns a value of 0, there is a division error and formula 1 returns NULL.
Formula 2
sum (case when ECA_SALES_CREDITS_MV.) ACCOUNT_CODE = 'LICENSE' THEN ECA_SALES_CREDITS_MV. TRANSACTION_AMOUNT_SUM 0 otherwise fine)

My question is how formula 1 may return 0 instead of NULL when there is an error in division.
Would appreciate your help.

Thank you
Guy
case when sum(case when ECA_SALES_CREDITS_MV.ACCOUNT_CODE = 'LICENSE' THEN ECA_SALES_CREDITS_MV.TRANSACTION_AMOUNT_SUM else 0 end) = 0
     then 0
     else (sum(case when ECA_SALES_CREDITS_MV.ACCOUNT_CODE = 'PRODSUPP' THEN ECA_SALES_CREDITS_MV.TRANSACTION_AMOUNT_SUM else 0 end) /
           sum(case when ECA_SALES_CREDITS_MV.ACCOUNT_CODE = 'LICENSE' THEN ECA_SALES_CREDITS_MV.TRANSACTION_AMOUNT_SUM else 0 end)
          ) * 100
end

Concerning

Etbin

more readable:

case when sum(case when ECA_SALES_CREDITS_MV.ACCOUNT_CODE = 'LICENSE'
                   THEN ECA_SALES_CREDITS_MV.TRANSACTION_AMOUNT_SUM
                   else 0 end
             ) = 0
     then 0
     else sum(case when ECA_SALES_CREDITS_MV.ACCOUNT_CODE = 'PRODSUPP'
                   THEN ECA_SALES_CREDITS_MV.TRANSACTION_AMOUNT_SUM
                   else 0 end
             ) /
          sum(case when ECA_SALES_CREDITS_MV.ACCOUNT_CODE = 'LICENSE'
                   THEN ECA_SALES_CREDITS_MV.TRANSACTION_AMOUNT_SUM
                   else 0 end
             ) * 100    /* intentionally left as original */
end

Tags: Database

Similar Questions

  • Web site created by Muse. The greats until tweek of today. Web site insists now for open index.html in the tablet. Don't know how product, nor how to change the default value for pc of office/index.html. Would advise. Bob

    Web site created by Muse. The greats until tweek of today. Web site insists now for open index.html in the tablet. Don't know how product, nor how to change the default value for pc of office/index.html. Would advise. Bob

    Hi Bob

    I think that you have found the solution but if still you are facing the question, please give me the url of the site that opens another provision in the tablet.

    Please make sure desktop redirection is checked in the site properties page layout.

    Thank you

    Sanjit

  • How to change the default value of MS Paint record - an output to jpg for shortcuts KEYBOARD: Alt-F-A (or S)?

    I've seen a lot of posts on this subject here, but they are all on the use of the mouse and I did not yet find one with an answer to MY specific dilemma.

    I take screenshots and edit photos (Nothing fancy) almost every day. Given that my physical disability in my arms causing me pain and discomfort when I use the mouse, I need to use several shortcuts as humanly possible help reduce the constant pain, I'm still in my right arm using the mouse.

    I *need* to know how to change the default hotkey Alt-F-A (or S) to save it as a JPG file relative to the current default value PNG which I use never, never. If it requires editing the registry, no problem, just point me in the right direction and guide me on how to do it.

    Thank you

    Lee

    LAST UPDATE 09/30/15 @ 16:54:

    The solution to my dilemma can be seen in my other thread (analogue/reprise). It is in case anyone in the future stumbles across this thread with the same problem and needs the answer.

    Since this thread will not be deleted, I would would add the link to the solution in case anyone stumbles across this in the future.

    See my other thread at: [Solution here]

  • How to change the default value of a parameter and LOV attached to a parameter

    Hi all

    I'm new to the discoverer reports and I need the following tasks:
    1. the need to change the SQL of a discoverer report
    2. need to change the default value of the parameter (from constant for the current month). In the discoverer more responsibility when I open the report and go to tools > > setting > > edit
    I can see the value of the default constant is given. On the right side there is a drop down that says "Value". I suppose that if I put a SQL as default, I need to change the drop-down list for sql or something and then put the code SQL. Problem is the menu drop-down is froezen and I can't change it.
    Even if I try to create a new report parameter.
    3 need to change the LOV associated with the element on which is based the setting.


    I have the discoverer more responsibility to myself and did not have the discoverer administrator (as forms 6i developer desktop tool) tool. My questions are:
    1. can I modify the SQL query using discoverer and responsibility or do I discoverer Administrator tool?
    2. any help on how to get the default value of an SQL query? Currently, it is a constant value.
    3. is there a way to understand is that the LOV is made of the constant values fixed (as a set of values independednt) or they are read in a SQL (value valid table sets)?

    Solutions pointers will be greatly appreciated!
    Thanks in advance.

    Thank you and best regards,
    Shashank

    It is not possible to use a default calculation for a paraeter

  • How to convert the Null value to 0 after the outer join?

    Hello guys

    My requirement is in fact 2 of outer join tables (that's how), and I got the outer join works very well, so in my report, I have values null of measures in another table of facts as a result of the outer join...

    Is there a way I can convert these nulls to 0?

    I realized that the null value is not stored in the table, it is just following the outer join because the NULL do not match records in other... So by default, I'm expected to get NULL values...

    Is there way to present these nulls to 0?

    Thanks a lot for your advice

    In response, the syntax will be:

    IFNULL (, 0)

    try and let us know how you go.
    See you soon
    Alastair

  • How to change the constant value for the property node "Disabled"?

    Hi all

    I enclose one vi example of what I'm willing to do. It happens during the event for "left selectorrogrammed 1: changing values.»

    Basically, I created a property to a Boolean LED control node. Once clicked, I'm eager to turn it off so that the user cannot change the value (I have a reset all button for use on that).

    I created the node property for this control for disabled people.  When I'm in the block diagram, I change to write mode.

    I rt clicked on it and said: ' create constant ", he does.  However, the constant comes each time as "Enabled". I tried clicking on this constant and looking through all of that property, but I can't find a way to scroll the values or set the value of this constant to "Enabled" to "disabled."

    I see where you can change the elements of this constant... but I guess there is a way to switch this constant to the value you want... any suggestions?

    Thanks in advance,

    Cayenne

    To change a constant value, your cursor must be in the mode 'finger '.

    You can select this option in holding down the SHIFT key and right-click on the diagram - then select the finger.

    Another way is to put the automatic selection of tools:

    Tools > Options > environment > lock automatic selection of tools

    With this option, LabVIEW will choose the tools for you.

    Play with him a bit to see how it works.

    Steve

  • How to change the default value for [Black] RGB to CMYK Indesign CC2015

    I inherited a file which is defined by default black in RGB. In the preparation of the document, its intention is set up to print. How can I change the mode from RGB to CMYK color? I already tried to convert profiles and assigning profiles. I use InDesign CC2015.

    Thank you!

    Create a new print document with the same basic grid settings and the same size of document with page 2.

    Drag all the pages from one to the other document.

    Remove the first 2 pages.

  • How to change the initial value of the list of choices that has the property of view definition

    Hi guys,.


    My list of choice for oracle seeded page has not defined property Viewdefintion view instance & I have my working to change its defauilt value but not until now no success...:)
    any suggestion is more valuable to me. Please helppp guys...

    Thnx in advance
    Sims

    Hello

    Yes, if necessary, you can set the PFR value too, there is no harm.

    Thank you
    Pratap

  • How to change the threshold value

    Hello

    I want to change the default threshold my threshold of space available on the VM disk... Please share the document

    Kind regards
    Gopi

    Hey Gopi,
    If I understand correctly, you want to adjust the thresholds for alarms.
    The Foglight registry has all these variables. We recommend that if you change something, you take note in the variable about which was the default, time, reason, etc.
    In the dashboard:
    The administration | Rules & Notifications | Manage the registry Variables
    In addition, you can change the rules. If you want to change the rules, please COPY the rule and disable the original rule. Make changes to the copied rule.
    In the dashboard:
    The administration | Rules & Notifications | Manage rules
    VFoglight documentation is available if you connect to the site Vizioncore, go to the Downloads tab and then select the content sub-tab.
    If you have a more specific question, please just after it.
    Thank you
    -dave

  • How to change the default value of Corel PhotoPaint PhotoPaintwhen paint is not one of the options?

    When I need to work on a photo in PhotoPaint, I change to a .bmp file in CorelDraw and click "edit the bitmap image. It then goes into PhotoPaint for editing - however. PhotoPaint option programs in default has somehow got changed "Paint" and well I tried back in PhotoPaint, which is not part of the data options and does not appear in any list. If I dig pretty far to find PhotoPaint, Windows will not be, PMB default program and I cannot continue my project.

    How can I get the program by default back to PhotoPaint for .bmp files?

    I meant that you have to right click on a *.bmp file (that you find using Windows Explorer), right-click on it once you've already opened with PhotoPaint.

    If you go to default programs > associate a type of file or Protocol with a specific program > Exchange program

    or right-click on a *.bmp file and select open with, you find yourself in the same place - the 'Open with' dialog box.

    In the 'Open with' dialog box, you click on the "Browse" button and then start to explore in Corel Suite 13 > Photo Paint.

    At this point, you need to determine which of the files is PhotoPaint himself.  I have installed PhotoPaint, so I can't tell you the exact name of the file to search (it's probably "Corel PhotoPaint.exe"), but here's a way to know.

    If you have a shortcut on your desktop to launch PhotoPaint, right-click on this shortcut and select "Properties".  If you do not have a shortcut on your desktop, click on the circle to start, scroll to find Corel PhotoPaint, right-click on it and select "Properties".

    The 'Shortcut' tab should already be selected (if not select it).

    Look at the 'target' and if necessary, use the mouse or the right arrow key to make sure you're looking at the right end of the line.  The program after the last-character is the file that you need to search for and 'Open' when you navigate in Program files.

    Here is an example for Corel PaintShop Pro X 8, which, in this example, is in

    C:\Program Files (x 86) \Corel\Corel PaintShop Pro X 8

  • How to handle the null value

    Hi all

    Can someone tell me how to handle null.

    I have a radio button, I need to capture the worth and inspiring I have a search criterion.

    If I select the radio button without problem. If I did not choose the option button it gives me the error.

    OAMessageRadioButtonBean var1 = (OAMessageRadioButtonBean) webBean.findChildRecursive ("job");
    If (var1! = null)
    {
    S1 = var1.getValue (pageContext) m:System.NET.SocketAddress.ToString ();
    }

    Please suggest.

    Kind regards

    Sangu

    S1 = (String) var1. GetValue (PageContext);

  • How to change the default value for the Windows Explorer window resizing

    I recently reinstalled XP and now when I open Windows Explorer, the window opens it up to a size of about 1/8 of the size of the screen.  I keep the resizing to how I like it, but every time that I re - open, he is reduced to the size of 1/8th.  How can I make my default size size that Windows Explorer opens up to.

    I have already tried:

    Open a window and make it the size you want

    Open a 2nd window and are the same size.

    The 1st window to the front, hold CTRL and click the red X in the upper right corner.

    Close the window of the 2nd in the same way using CTRL.

    Display settings files from the tools-> Folder Options-> view tab-> advanced settings, managing pairs of Web pages and folders, check the DISPLAY SETTINGS of don't forget NOT EVERY FOLDER

    None of those who work.
    Help please!
    Any window that you want to resize all the time must be the last closed window. This includes now does no other windows minimized in the taskbar.
     
    Take the corners of the window and drag it to the format full screen. Do not use to expand. Close all other windows all first via the taskbar and this one last. Windows will remember the size of the last closed window the next time that you open the program.
     
     

     
  • Permanently change the default value of the police and the size in hotmail

    I know how to change the size of police and style in hotmail for each email but not how to change the default value.

    Hotmail forums:

    http://www.windowslivehelp.com/forums.aspx?ProductID=1

    They will help you when repost you your question in the Forums above for Hotmail.

    See you soon.

    Mick Murphy - Microsoft partner

  • How to change the default save to C: disk / d: /.

    I saw the article about how to change the default value.  I only did this and is installed by default on the D drive, but the computer still records in two drives and does not record on 'my documents', but saves just 'documents '.  When I click on the file I save it says it is registered in two places.  When I click on the two places, it shows that the default is now D: which is what I want.  I don't want for the file to be saved in two places.  Is there a way to save only on D: and eliminate the duplicate record on C: not safe if possible... help will be appreciated.  Thank you.

    Westley

    When you say c: documents and D:Documents, can provide you the full path you are viewing?

    The real essentials you need to know is that libraries are not records.  They are really just a quick search of several places.  Try this: right click on the document library and select Properties.  This will tell you where the library is looking.  Whenever you open the document library, it performs an instant analysis of these places and tells you what he found.  Is not additional copies files, it's just search results. If you delete something, you remove the one and only original, everywhere where it is.

    You might ask "well, what's the point of a library?  I'm glad you (perhaps) asked.  The reason is you have a lot of places.  Take me for example.  I have some movies on my hard drive.  I have more moves on an extra drive (they will all take place on the main drive).  In addition, my roommate has a few movies on his drive.  With a library, I have a library of videos that research on all drives and gives me a single view combined all our movies instantly.  Now I can see all my films in my library at the same time, no matter which disc they are on.

  • Change the default value of column NOT NULL to NULL

    Hi all
    How can I change the default value of column not NULL to NULL?
    Suppose I have run the following commands:
    SQL> alter table hr.test modify temp_num2 default null;
    
    Table altered.
    
    SQL> desc hr.test;
     Name                            Null?    Type
     ----------------------------------------- -------- ----------------------------
     TEMP_NUM                             NUMBER
     TEMP_NUM2                       NOT NULL NUMBER
    Why forced temp_num2 has not changed with the NULL value? I'm under 11.g rel2

    Best regards
    Valerie

    You can NOT change the column constraint NULL to contain NULL values by:

    alter table table_name modify column_name null; 
    

    After this change, the column can contain null values. In Oracle, not null constraints are created automatically when not null is specified for a column. Similarly, they are deleted automatically when the column is changed to allow NULL values.

Maybe you are looking for

  • problem image acquisition

    Hello I try to read my camera webcam images I install the visision software machine but this problem appear which lies in the acquisition of the vision No inilization apeaer menu after add it on the front I click on it but nothing happens Oh God, wha

  • Strategy group by using server 2003 standard edition; I want to disable the software / hardware installation

    Original title: I have a question related to group policy I have a question related to group policy We are using server 2003 standard edition and I want to disable the software / hardware installation users cannot use usb ports, CD/DVD Download, stre

  • Transfer between Cisco ASA VPN Tunnels

    Hi Experts, I have a situation where I need to set up the transfer between two VPN Tunnels completed in the same box ASA. A VPN Tunnel will incoming traffic and that traffic should be sent to the bottom of the other VPN Tunnel to the ASA. The two VPN

  • Bug in browser when you are connected to my CC account

    HelloI saw a payment for mentioned Adobe as "DRI * Adobe SYSTEMS ' in my bank statement yesterday for a few hundred euros, and my renewal is supposed to happen in November, not June...And when I connect to my account from the CC app, I get redirected

  • Why are the objects stick offset from the Group?

    Sometimes when I copy and paste from a file HAVE to another, some objects stick in the wrong position. Below, before and after images. As you can see that the arrows are not where they should be. How can I stop this from happening?BEFORE:AFTER: