Cubeset with topcount and several filter - problem

jazpar

New Member
Joined
May 9, 2015
Messages
7
Hi

As a newbi in using excel cube formulas I have a problem I hope someone could be helping with.

Issue:
Getting top 5 top- and bottomcount for Customergroup.
The count should respect:
Selected Company dimension (there are several companies 10-15)
Selected invoiceperiod dimension

Cubeset formulas:
Topcount
CUBESET("Sales","topcount(([Company].[Company].["&$C$10&"],[Customer].[CustgroupIdName].children),5,sum(([Company].[Company].["&$C$10&"], [InvoiceDate].[YearMth].["&$C$16&"], [Measures].[LineAmount])))","Top 5 Customergroup")
Bottomcount
CUBESET("Sales","bottomcount(([Company].[Company].["&$C$10&"], [Customer].[CustgroupIdName].children),5,sum(([Company].[Company].["&$C$10&"], [InvoiceDate].[YearMth].["&$C$16&"], [Measures].[LineAmount])))","Bottom 5 Customergroup")

Cuberankedmember formula:
CUBERANKEDMEMBER("Sales",Top5Kundegrp,$I3)
(I3 = the rank eg. 1)

Cubevalue formula:
CUBEVALUE("Sales",$J3, $C$16,"[Measures].[LineAmount]")
(J3 = the cuberankedmember; C16 = [InvoiceDate].[YearMth].[2014 - Jan])

Remarks:
[Company].[Company].["&$C$10&"] = [Company].[Company].[USMF]
[InvoiceDate].[YearMth].["&$C$16&"] = [InvoiceDate].[YearMth].[2014 - Jan]


Shown for the topcount:
Rank
(typed in number Column I)
Customergroup
(Cuberankedmember formula in Column J)
Lineamount
(cubevalue formula in Column K)
Remarks
130 - Retail customers 2,052,524.00Values and group from USMF company
210 - Wholesales customers1,803,576.00Values and group from USMF company
390 - Intercompany customers328,130.00Values and group from USMF company
490 - Intercompany customersZero value and group from company NOT selected
5010 - Clientes região SE (Sudeste)Zero value and group from company NOT selected

<tbody>
</tbody>

Could anyone help how to ensure:
When rank 4 and 5 are empty for the selected company – then don’t show those.
Why are they shown when in the cubeset I tried to filter on ONLY the selected company.

Thanks and have a nice weekend
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
OK have a google dev account, uploaded the files. But from here how do I fullfill the next step :-)
 
Upvote 0
Hi jazpar,
Your CUBESET is only filtered by the Company code, so it will always return all CustgroupIdNames within that CompCode, irrespective if they have sales or not. You can insert a non-empty-clause, that will reduce to non-empty values:

=CUBESET("Sales";"topcount(nonempty([Customer].[CustgroupIdName].children, [Company].[Company].["&$C$8&"]),5,sum(([Company].[Company].["&$C$8&"], [InvoiceDate].[YearMth].["&$D$13&"], [Measures].[LineAmount])))";"Top 5 custgroup")

You also need to Switch the Company & CustgroupIdName as you see in the bold section.

Then in your Top5-Table you wrap your formula in an iferror-clause and everything should look nice :-)
 
Upvote 0
Hi Imkef,

this worked out perfectly.
Do you know how a similary count could be made for total custgroup members with values for the company and selected invoice period.

In that way I might build a solution with no empty cells. Eg. in my test data there is only 4 custgroup as max for all companies with value. Some have only 2 or 3 custgroup. So for one company I could have a top 3 and a bottom 2. But the same formula would give me one of the members in both the top and the bottom list.

In advance thanks

BR

Jan
 
Upvote 0
Hi Jan,
having difficulties in understanding your question.

With one table for Top5-Count and one for Bottom5, there will always be some CustGroups that appear in both tables as long as the selection returns less than 10.

So what do you mean with trying to "build a solution that has no empty cells"? Of course you could eliminate the Company-Filter in order to make the return-set bigger - but wouldn't that change the meaning of the report?

This would be it: =CUBESET("Sales","topcount(nonempty([Customer].[CustgroupIdName].children),5,sum(([InvoiceDate].[YearMth].["&$D$13&"], [Measures].[LineAmount])))","Top 5 custgroup")

Otherwise please help me understand what you try to achieve :-)

Thanks, Imke
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top