4

I am using Excel 2010 to create a list of the top 10 vendors by sales during a specified time period. The catch is that I need to consider only customers that are a member of a particular set. I found this article which has helped me get the Top 10 vendors for sales from all customers, but I'm struggling with how to sum only over the members of a particular set. I tried the Sum/CrossJoin example that is further down the page in the comments, but I was unable to get it to work. It could be that I'm pretty new at this and just don't understand which pieces need to go where. Here is what I have so far (my connection name is in cell M1):


All Customers (works perfectly):

=CUBESET($M$1,
         "TopCount(
           [Product].[Brand].Children,
           10,
           Sum(
             [Time].[Calendar].[Calendar Month].&[2011]&[8],
             [Measures].[Revenue]
           )
         )",
         "Top 10 Brands"
)


Subset of Customers (appears to return correct set):

=CUBESET($M$1,
         "Intersect(
           Intersect(
             exists(
               [Customer].[Cust Num].Members,
               {[Customer].[Is Internal].&[False],[Customer].[Is Internal].[All].UNKNOWNMEMBER}
             ),
             exists(
               [Customer].[Cust Num].Members,
               [Customer].[Type].&[CAT]
             ),
             ALL
           ),
           exists(
             [Customer].[Cust Num].Members,
             [Market].[Market ID].[All].Children - [Market].[Market ID].&[3] - [Market].[Market ID].&[4]
           ),
           ALL
         )",
         "Cust Group"
)



Any help and/or guidance would be greatly appreciated.....thanks in advance!

Tom
  • 208
  • 1
  • 3
  • 8

1 Answers1

4

You could try something like this

=CUBESET($M$1,
     "TopCount(
       [Product].[Brand].Children,
       10,
       Sum(
            (
                [Time].[Calendar].[Calendar Month].&[2011]&[8],
                [Customer].[Is Internal].&[False],
                [Customer].[Type].&[CAT]
            ),
         [Measures].[Revenue]
       )
     )",
     "Top 10 Brands"
)
milang
  • 76
  • 4
  • I had come up with an alternate method of deriving this list, however, this worked perfectly and I will likely end up replacing my workaround with this solution. Thanks milang! – Tom May 31 '12 at 16:37
  • This is Amazing! I was trying to get top 10 using just NONEMPTY() in the CUBESET. It always spat out random results in no particular order. Adding the TOPCOUNT with the SUM technique solved a problem I was unable to solve in a long time. Thank you! – Ejaz Ahmed Jul 19 '20 at 11:54
  • I am facing a small problem with this solution. It always shows 10 results even if there is only one member with a Non-Empty SUM. How can I modify this expression to only show non-empty sums? – Ejaz Ahmed Jul 19 '20 at 12:53