MDX Named Set Help

largeselection

Active Member
Joined
Aug 4, 2008
Messages
358
Hello,

I'm using Excel 2010 with an OLAP cube and I need some help with named sets via MDX. Is it possible to create a named set which basically groups and subtotals data? So if I have 10 employees and they are equally divided in 2 states is it possible to create a named set which is like the below:

Original Data:
Emp1-NJ
Emp2-CT
Emp3-NJ
Emp4-CT
Emp5-NJ
Emp6-CT
Emp7-NJ
Emp8-CT
Emp9-NJ
Emp10-CT

New Named Set:
NJ Total of Emp1, Emp3, Emp5, Emp7, Emp9
Emp1
Emp3
Emp5
Emp7
Emp9
CT Total of Emp2, Emp4, Emp6, Emp8, Emp10
Emp2
Emp4
Emp6
Emp8
Emp10

Currently I'm able to create a named set that can do this for one group as below:

For example this is an example of the NJ group
Code:
VisualTotals({([Employee].[Employee].[All]),([Employee].[Employee].&[473]),([Employee].[Employee].&[7945]),([Employee].[Employee].&[8464]),([Employee].[Employee].&[8564]),([Employee].[Employee].&[8796])})

That creates a set that is comprised of just the 5 employees in NJ and the subtotal of just those 5 members.

Is it possible to have multiple groups like that, but in one set? I'd rather not have to make a table for each individual state.

Thanks!
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,215,043
Messages
6,122,825
Members
449,096
Latest member
Erald

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