Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

TOP N Function and OTHERS for values that aren't in TOP clause

MarcosSpínolaJul 26 2010 — edited Jul 26 2010

Hi there... This is easier to be explained with examples. Suppose there's a table with 5 records.You need to order them and use a TOP N function to show the top 3 items. So far, that's easy!

But I need to show all the other 2 records as OTHERS, and have all of them summarized. It would be something like this:

The flattened table:

Code	Value
1	2,000
2	1,500
3	1,000
4	800
5	600

And I need to show it in answers like this:

Name	Value
Number1	2,000
Number2	1,500
Number3	1,000
OTHERS	1,400

How do I display OTHERS for those values that will be excluded when I create a TOP N function?

Thanks in advance

This post has been answered by Vinodh NK on Jul 26 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details