Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 182883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:01:06+00:00 2026-05-11T15:01:06+00:00

I have created an MDX query which calculates the TOP 10 ZipCodes (according to

  • 0

I have created an MDX query which calculates the TOP 10 ZipCodes (according to my Patient Stay measure) as such:

WITH MEMBER [Discharge Date].[Y-M-D].[ Aggregation] AS 'AGGREGATE( EXISTING { [Current Month] } )', SOLVE_ORDER = 0  SELECT NON EMPTY { [Measures].[Patient Stays] } ON COLUMNS,  TOPCOUNT({ ORDER( HIERARCHIZE( { [Patient].[ByZipcode].[All].CHILDREN } ), ( [Measures].[Patient Stays] ), BDESC ) }, 10) ON ROWS  FROM [Patient Stay]  WHERE ( [Discharge Date].[Y-M-D].[ Aggregation], [Facility].[ByAffiliation].CURRENTMEMBER, [Facility].[ByRegion].CURRENTMEMBER ) 

This query is used to populate a PerformancePoint 100% Stacked Bar chart. The client has asked that since this is a !00% based chart, we lump the rest of the zip codes into an ‘Other’ field, such that there should be 11 values: one for each of the top 10, and an eleventh which is a sum of the remaining Zip Codes.

I am an extreme novice to MDX, but this doesn’t souund like it should be impossible. Does anyone have any ideas or suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:01:07+00:00Added an answer on May 11, 2026 at 3:01 pm

    I’ll do my best with untested code, so here goes:

    WITH MEMBER [Discharge Date].[Y-M-D].[ Aggregation] AS 'AGGREGATE( EXISTING { [Current Month] } )', SOLVE_ORDER = 0  SET [Top10ZipCodes] AS      (TOPCOUNT({ ORDER( HIERARCHIZE( { [Patient].[ByZipcode].[All].CHILDREN } ), ( [Measures].[Patient Stays] ), BDESC ) }, 10))  MEMBER [Patient].[ByZipCode].[OtherZipCodes] AS      (AGGREGATE({EXCEPT([Patient].[ByZipCode].Members, [Patient].[ByZipCode].[Top10ZipCodes])}))  SELECT NON EMPTY { [Measures].[Patient Stays] } ON COLUMNS,  {[Top10ZipCodes], [Patient].[ByZipCode].[OtherZipCodes]} ON ROWS  FROM [Patient Stay]  WHERE ( [Discharge Date].[Y-M-D].[ Aggregation], [Facility].[ByAffiliation].CURRENTMEMBER, [Facility].[ByRegion].CURRENTMEMBER ) 

    What this does is creates a set of your top 10 ZIP codes, and then aggregates (different than sum!!!) all the ZIP codes, with the exception of your top 10.

    Also, if this is a common set (top 10 ZIP codes), you may want to make a set on the cube, where you can reuse it ad nauseum, without having to change every MDX query you have.

    Cheers,
    Eric

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a report which was built on MDX-query: SELECT {[Measures].[IssueOpened] } ON COLUMNS,
I have created a function that shows/hides different messages according to a combination of
Have created a ATL COM project through which I am inserting Menu Items to
We have created a .NET 4 web service, which runs fine on a Windows
I have created a bar chart which is a improvement of bar graph on
I have created an xPages application which uses a lot of server side javascript
I have created a module in Magento which takes certain views from customers about
Hallo at all! I have a little Problem with my Query in MDX. I
I have a correct MDX-query: SELECT NON EMPTY { [Measures].[IssueOpened] } ON COLUMNS, NON
I have created a class CurrentDate which shows the system date in a particular

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.