Possible new feature percentile?

Hello

I am running "Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production".

I need to calculate percentiles, so I think I have two choices: PERCENTILE_CONT() or PERCENTILE_DISC().
I also need to get the same results as SPSS and SAS tools.
By comparing the results, or versions of Oracle gives the same result as SPSS/SAS. I think it's because of the way Oracle determines which line numbers to use.

Oracle ranks RN = (1 + (classified *(N-1) p), where P is the percentile and N is the number of lines.
For PERCENTILE_CONT (0.1) of a set of 16 lines that would give a row 2.5 as starting point.
http://docs.Oracle.com/CD/B28359_01/server.111/b28286/functions115.htm

SPSS and SAS uses the formula RN = P *(N+1) which gives the rank 1.7 for a set of 16 lines.

Now, it would be possible for me to write a PERCENTILE_SPSS() function?

Examples of analytical/pipelined functions I have seen (and written) are happy to use the lines in the game one by one, to calculate a few special min/max/avg/etc.
For this function, I would need to be
1. to know the number of lines in the game, since the first call of my function and calculate the percentile as my function "passes" the desired lines
or
2 - save all values in the game and calculate the percentile at the end

The first sounds impossible, the second seems expensive for a large table.
Any suggestions?


Kind regards

Tomas

the second seems expensive for a large table

Yes, you are probably right. Write your own aggregate function involves many context switches between SQL and PL/SQL Engine runtime and possibly abuse of PGA memory keeping excessive values in tables and therefore is unlikely to perform as well a solution pure SQL, however desirable encapsulating function may at first seem.

I think using COUNT (*), to get the number of lines and follows the specification for PERCENTILE_CONT http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions110.htm#i1000909 will give you what you need to calculate, for example)

SQL> SELECT DECODE (
  2            MAX (CEIL (prn)),
  3            MAX (FLOOR (prn)), MAX (nr),
  4           (MAX (CEIL (prn)) - MAX (prn)) *
  5              MAX (DECODE (rn, FLOOR (prn), nr)) +
  6           (MAX (prn) - MAX (FLOOR (prn))) *
  7              MAX (DECODE (rn, CEIL (prn), nr))) percentile
  8  FROM   (SELECT ROWNUM rn, COLUMN_VALUE nr,
  9                 0.1 * (COUNT (*) OVER () + 1) prn
 10          FROM   TABLE (sys.odcinumberlist (
 11                    2, 5, 6, 8, 13, 14, 15, 18, 20,
 12                    23, 24, 28, 30, 31, 32, 35)))
 13  WHERE  rn IN (CEIL (prn), FLOOR (prn));

PERCENTILE
----------
       4.1

SQL>

Edit: with hindsight you may prefer the ROWNUM ROW_NUMBER analytic function because it would allow you to order explicitly by nr with unsorted data.

Tags: Database

Similar Questions

  • A possible new 'feature' folder manangement?

    I didn't know anyone still report...  But if I have a set of open files and create a new one, they're all close.

    This makes it difficult to reorganize things.

    For example, I took my main catalog and created a new project near / at the top level.  I began to do my normal year-> year_mon-> year_mon_day folder structure, so I could move around images of other records already in LR in there as a separate project.

    Whenever I do a folder, it collapses everything down and I must once again to get out there!

    If I highlights a single file in a project, then right-click on another file and use to create the structure of a folder I've highlighted remains open, but all others (including the one I created just) get closed.

    Someone already posted this problem yet?

    Mac, 10.5.8, LR3.2RC_r1

    See you soon!

    I can reproduce it on Lr3.2 but not Lr2.7, therefore it eirther new behaviors Lr3 + or a bug. My guess is that this is a bug and report it as such.

  • Is it possible to disable the new feature that lists the previous pages in thumbnails when opening a new page?

    Is it possible to disable the new feature that displays thumbnails of the previous page when you open a new tab?

    Hello, please see the following article for help in order to disable the new feature: customize the page new tab

  • The new feature, "New form Guides" can be configured to get the baseline?

    I love the new features Guide, long-awaited. This could be the case, I'll put in a feature request.

    New Guides in text form is auto-situer the outer limits, so the descender line down:

    default-text-guide.jpg

    I want to use instead of the more appropriate base line:

    suggested-text-guide.jpg

    Is this already possible? One of the first things I did was shortened the feature since it is something I do if often manually - it would be great if she could refer though either more (hold shift or something) or instead of the line of descendants. That's what designers use to align the text. Guides snap to the baseline already then Adobe has the system in place already.

    At the moment there is not a way to configure this feature to the base line, but it would be nice!

  • Hyperion Planning 11.1.2.3 new features

    Hi all

    I heard that the next version of hyperion planning (11.1.2.3) will introduce exciting new features among them: the ability to load data and metadata through a new user interface.

    I know that it is also possible to load data using the Essbase administration console, but there are certain rules to follow in the example of the use of special formatting for members that contain numbers, special characters of dashes, all these members should be put 'A - 100.

    Question: in fact these rules/constraints apply to the new load UI? have we not manage for example members containnig dashes?

    Thank you
    Best regards.

    According to me, which is probably best answered after that that he was released.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • StageVideo new feature available in Flash CS5?

    In the new Flash Player 10.2 BETA theres a new StageVideo feature, but as far as I can tell that this cannot be used last Flex/Flash Builder.

    Is it possible to use it with Flash CS5? Or does anyone know if there will be an update to support?

    The video link stage it also says: ' once it is part of a complete delivery version of Flash Player, video scene will work with all existing video on the web read in Flash Player "

    So all the video content Flash will use SV in the final version of 10.2? Because it would be to break some things like video scene can not have a channel alpha, blendMode, filter or mask applied. So I think there must be a way to choose if a video is used or not?

    Currently I don't think you can use StageVideo in CS5, I guess at one point that an update will be provided, or maybe we'll have to wait for CS6.

    Regarding your second question: no, not all video will use StageVideo, the developer will have the option to use either. So any old flash content will need to be updated to take advantage of this new feature.

  • New feature of CS - 4

    There are a few mountain, I saw a new feature in cs4, I'm not sure if it's here in dreamweaver or photoshop itself... I'll try to explain.

    This device gives people on a website the possibility to navigate in a larger image on my server, when you zoom in on the image, the server you new data and details in the image when it just gives you to expand an existing one.

    No idea what I'm looking for?

    Best regards, Michel

    Photoshop Zoomify (introduced in CS3)?

    http://www.photoshopessentials.com/photo-editing/Zoomify/

  • New feature (filter on reports)

    I just noticed that there was a new feature added in the last patch of OATS v9.10, so that you can filter reports based on a range of time. This is extremely useful, especially if you want to 'ignore' no ramp-up/ramp-down period and just take a sample while the test runs at the desired level.

    However, it doesn't seem to be a similar filter for graphics. Anyone know if this is possible? If this isn't the case, I hope that the service can be extended to graphs in a later version?

    Hi Ian,

    Scope time custom graphics is already available. Once a graph is rendered, click on change-> select the axis (x or y). You can change the min and the interval of maximum time for a graph (if any) or any other unit.

    See you soon
    REDA

  • 11g ASM the database using 10g will be the new features in 11g ASM available?

    We are on 10.2.0.3 database without ASM version. Convert now to 11g ASM.

    Can I take advatage of new features in 11g ASM with 10g RDBMS Database? If any limitation so that is advatge for me to go to 11g ASM on 10g RDBMS, as appropriate?

    Thank you
    Verdier

    Hello

    I was living benefits ASM 11 g as (ACFS, ADVM, instant, IIP of Placement Intelligent Data). I could be > to use one of these if my RDBMS is 10g?

    Here: [features enabled by disk group attribute compatibility settings | http://download.oracle.com/docs/cd/E11882_01/server.112/e10500/asmdiskgrps.htm#CHDBCHIH] there is a table with what is or is not possible to use depending on your configuration.

    The specific advantages/disadvantages if we opt for 11g ASM for 10g RDBMS DB? We are planing to implement this > so any information / documentary links will be appreciated.

    The main advantage is that a single instance of the ASM will be able to support different customer RDBMS and the main disadvantage is that not all ASM new feautures will be supported for disk groups that are defined for reduce the compatibility properties.

    It will be useful,
    Cerreia

  • New feature of Cp 3?

    On this web page ( http://www.adobe.com/products/captivate/productinfo/upgrade/) I see the Cp3 has a new feature:
    "Easily synchronize audio with slides and objects timed with real-time preview.

    Can someone tell me how to get this to the Cp3? I don't see anything different of Cp2.

    Hi Keith

    Captivate 2 you have no possibility to watch the slide unfold as you to record audio. In Captivate 3, you do.

    To do this, click the Audio > Record and choose either:

    * This slide
    * Project
    * From this slide

    Notice how you see a preview image of the slide above the legend and slide Notes. We had no ability to Captivate 2.

    See you soon... Rick

  • I downloaded Safari 10 and now every page that uses Java asks me to activate or not. How to avoid this new feature? I have problems to access my bank account.

    I downloaded Safari 10 and now every page that uses Java asks me to activate or not. How to avoid this new feature? I have problems to access my bank account.

    I think they mean JavaScript.

    In your Safari menu bar, click Safari > Preferences and then select the Security tab, and then select: Enable JavaScript

  • New features of useless iMessage to recipients not iPhone

    If I use the new features of iMessage such as bubbles floating across the screen, probably they didn't is visible only when the receiver uses also an iPhone and not a Samsung?

    Recipient must use iPhone with iOS10 if you want to full effect.

  • iOS10 - new features in Messages do not work

    I have a 6 sec and despite his iOS10, I am unable to use some new features.  Specifically, the expressions and celebrations all over the screen.  All the instructions I found indicate that you are supposed to hold the arrow 'send' in the text dialog box, but nothing happens.  All other tactile 3D features seem to work perfectly, so I thought maybe it was only for iPhone users 7.  My mother just got his (mine comes tomorrow) and she knows the same thing... no workie workie.

    Anyone know why or what we might hurt?

    Hello

    You send or receive the bubble or full screen effects if reduce Motion is running.

    • Go to: settings > general > accessibility > Motion reduce > disable.

    Effects of the message can apply to messages sent through iMessage (own Apple service), which appear in blue in the Messages. They cannot be applied to SMS or MMS messages (shown in green).

    More information:

    Use effects of message with iMessage on your iPhone, iPad and iPod touch - Apple Support

  • What is the best way to communicate my displeasure with new features?

    TL; How can Dr. I complain to FireFox on the new search bar in new tabs? (Or other news)

    I saw a question or two about this new feature here already, and it is obvious that the developers of FireFox are not really interested in what their users think of this feature.

    The function I want to talk about is the new search bar in the new tab.

    I tried a fix mentioned in a previous post (create a subdirectory "Chrome" and create a CSS file that contains commands to specific style) and it did not work. I tried a few other corrections mentioned on other websites as well, does not.

    Knowing that FireFox would add something like this without allowing an option to disable it is pretty discouraging. I've been enjoying my daily use of FireFox on other browsers that I had used in the past because they were crowded and unclean, and FireFox was not at the time. This search bar ruined who. My pinned tabs were crushed about half of their original size, and the search bar is unsightly, at best.

    Correct me if I'm wrong, but don't we already have a search at the top of the screen bar? I don't see any purpose in this area, except in the gene users. If there is another use, please inform me (although to be completely honest, it will not change my opinion here, although it can mitigate the damage)

    Still, there have been very few features in FireFox that I was unhappy, and each of them was immediately followed by an add-on to turn them off (or they came with an option to disable their release)

    I'm not here asking for help on how to remove the search bar, I plead here for a link that I can use to communicate directly to the developers of FireFox to my opinions about this update.

    On a third party site, I read an article that made one of the developers made mention of an option for users to disable this search bar... According to the article, he has never received response.
    Which reminds me, if FireFox won't listen to his own team, we expect they are listening?

    I'm pretty close simply leaving FireFox because of this feature, because now it is little better than what I have left in the past. PaleMoon was nice, although a little more slowly.

    I'm not saying I'll stop using FireFox, only I'm quite put out because of what I read and the lack of an option to disable this feature.

    If such an option exists already, please give me instructions on how to do it and then well want to ignore this request.

    Thank you for taking the time to read this and have a nice day.
    Dillon P.

    R.E. - newTab search bar

    My guess is that by Firefox 34 or 35, the search bar in the Navigation toolbar won't go away. But before that, some kind of 'widget' should be added to allow the user to choose between their search engine installed various plugins.

    After all, how many places should a user have a 'search bar '?
    Why waste space on the navigation bar when the user can 'search' in the address bar and the subject: House and about: newtab pages.

    Create a text file named userContent.css and who put in the newly created folder /chrome/ in the profile folder.

    @-moz-document url(about:newtab) {
      #newtab-search-container, #newtab-search-logo
      { display:none !important; }
      }
    

    You can also use these do Firefox "user mods:

    -Elegant
    https://addons.Mozilla.org/en-us/Firefox/addon/stylish/

    ChromEdit or more.
    http://webdesigns.MS11.NET/chromeditp.html

  • New features of iOS 9 not available

    I have an iPhone 6s I got last July. Since the upgrade to iOS 9, I was not able to access the new features such as the touch 3D and Photos Live. When I go into settings > general > accessibility, there is no option of touch 3D. And when I open the camera app, there is no Live Photos option.

    I was hoping that it could be cured by updating to the latest version, but also no.. Just updated to iOS 9.3 and still no new options in sight.

    Any ideas?

    These functions require a 6 or 6 s iPhone more.

Maybe you are looking for