Skip to Content
author's profile photo Former Member
Former Member

Top 10 Customers and Others

Hi, I need to create a report to show the Top 10 Customers and then a line for Others. Anyone know the best way to accomplish this?

Thanks

Add comment
10|10000 characters needed characters exceeded

5 Answers

  • Posted on Nov 09, 2005 at 01:26 PM

    Hi Kenneth,

    I don’t think it’s possible directly.

    We can create a variable with replacement path which will accept Top N values from a query, and even use this variable for restriction in another query. The problem is that this usage is very limited. For example, we can use this var for restricting a char in rows or columns. The issue here that this var CANNOT BE USED IN STRUCTURES:

    http://help.sap.com/saphelp_nw04/helpdata/en/22/1e9b3c334d8c15e10000000a114084/frameset.htm

    However, for getting desired result we must use a structure:

    - Selection - char restricted by the var

    - Selection – char without restriction (total value)

    - Formula – 2nd row minus 1st one

    So, the only way to achieve the goal I can think of (and I implemented it before) is using of 2 queries (Top N & total) and VBA for placing totals into the proper place after Top N rows and calculating the difference.

    Best regards,

    Eugene

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 22, 2004 at 10:52 PM

    Hi Kenneth,

    use a condition in your report on the customer object.Hope this helps.

    Ravi.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2005 at 12:41 PM

    Hello Kenneth,

    DId you find a solution for this problem? I'm trying to add an "others" total to a Top N query, and would appreciate some help with resolving it. I've read this topic and a few others that are similar but cannot see the solution.

    Thanks in advance,

    Pat M.

    Add comment
    10|10000 characters needed characters exceeded

    • No really good solution. Can anyone detail a plan to get a top n listing and an additional line for all others?

      Example: Top 3 Sales Order Customer Report

      Line 1 Customer Amazon 10,000 Orders

      Line 2 Customer Best Buy 5,000 Orders

      Line 3 Customer Yahoo Stores 2,000 Orders

      Line 4 All Others 3,000 Orders

      Total Orders 20,000 Orders

      Of course the condition could change to Top 10 or something else...

  • author's profile photo Former Member
    Former Member
    Posted on Apr 05, 2007 at 12:55 AM

    Eugine,

    So, the only way to achieve the goal I can think of (and I implemented it before) is using of 2 queries (Top N & total) and VBA for placing totals into the proper place after Top N rows and calculating the difference.

    Could you please provide me the VBA Code here. Thanks a lot for your help.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 05, 2007 at 04:43 AM

    You can accomplish this with one query using standard condition and then calculating the other totals in Excel. Since the overall results are not affected by the conditions unless you specify to calculate as summation you can keep this as undefined. This is your Grand total. With Excel, you can easily just sum up the top 10 total and then subtract the top 10 total from the grand total.

    If you need to do this in the web, the only option I have done successfully was to use the Web Table API in 3.x environment to do the same as stated adove.

    Thanks,

    Jeff

    Add comment
    10|10000 characters needed characters exceeded