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 6957855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:03:57+00:00 2026-05-27T15:03:57+00:00

I want to create a calculated member and filter it by dimension. This is

  • 0

I want to create a calculated member and filter it by dimension. This is WORKING example:

(
    [Policy].[Policy Status].&[Void], 
    [Policy].[Tran Type].&[Renewal], 
    [Measures].[FK Policy Distinct Count]
)

But if I want to filter it like this

(
    [Policy].[Policy Status].&[Void], 
    [Policy].[Policy Status].&[Policy],  
    [Measures].[FK Policy Distinct Count]
)

Than it’s NOT working. It says that same hierarchy is showing multiple times in the tuple.

Another thing is, how to exclude rows? Here’s the idea…

(
    ![Policy].[Policy Status].&[Void], 
    ![Policy].[Policy Status].&[Policy],  
    [Measures].[FK Policy Distinct Count]
)
  • 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. Editorial Team
    Editorial Team
    2026-05-27T15:03:58+00:00Added an answer on May 27, 2026 at 3:03 pm

    First, it’s important to understand the MDX syntax, and how it related to the concepts of tuples, members and sets.

    Tuples

    Using parentheses denotes a tuple:

    (
      [Policy].[Policy Status].&[Void], 
      [Policy].[Tran Type].&[Renewal], 
      [Measures].[FK Policy Distinct Count]
    )
    

    A tuple can only include a single member from any hierarchy.

    Sets

    To retrieve results from multiple members in the same hierarchy, you must query for a set. An MDX set is denoted by braces:

    {
      [Policy].[Policy Status].&[Void], 
      [Policy].[Policy Status].&[Policy]
    }
    

    A set is, by definition,

    an ordered collection of zero, one or more tuples.

    So, if you wish to query for the [FK Policy Distinct Count] measure against both of those members, the set’s tuples must each include the measure:

    {
      ( [Policy].[Policy Status].&[Void],   [Measures].[FK Policy Distinct Count] ), 
      ( [Policy].[Policy Status].&[Policy], [Measures].[FK Policy Distinct Count] )
    }
    

    To simplify this expression, it is possible to crossjoin two sets of different dimensionality:

    {
      [Policy].[Policy Status].&[Void],
      [Policy].[Policy Status].&[Policy], 
      [Policy].[Policy Status].&[Something], 
      [Policy].[Policy Status].&[Something else], 
      [Policy].[Policy Status].&[Yet another member]
    }
    *
    {
      [Measures].[FK Policy Distinct Count]
    }
    

    Excluding rows

    Now that we can define sets, it’s time to remove some members from one. In your example, it sounds like you want to start with a level (which, to the MDX engine, is just a predefined set in the cube which includes every member at that level of the hierarchy), and exclude certain members. MDX has lots of functions that operate on sets, and we’re going to use EXCEPT.

    The EXCEPT function takes two parameters, the first being the set to remove from, and the second being the set which should be removed from the first. It returns a set.

    In this example, I’m going to assume [Policy].[Policy Status] is an attribute hierarchy, and that its sole level has the Unique Name of [Policy].[Policy Status].[Policy Status].

    EXCEPT(
      [Policy].[Policy Status].[Policy Status],
      {
        [Policy].[Policy Status].&[Void],
        [Policy].[Policy Status].&[Policy]
      }
    )
    

    This will return every member from the [Policy].[Policy Status].[Policy Status] level, except for [Policy].[Policy Status].&[Void] and [Policy].[Policy Status].&[Policy].

    To get useful results, we can cross-join the result by a measure:

    EXCEPT(
      [Policy].[Policy Status].[Policy Status],
      {
        [Policy].[Policy Status].&[Void],
        [Policy].[Policy Status].&[Policy]
      }
    )
    *
    {
      [Measures].[FK Policy Distinct Count]
    }
    

    Using a set as a single member

    Sets are nice, but sometimes all we want from them is to treat them as a single member, as in your calculated member requirement. To do this, we need to use an aggregation function. Aggregation functions take in a set and return a member that represents the entire set.

    There are a number of these, and the right one to use depends on the data stored in your cube: MIN, MAX, COUNT, and SUM are some of them (see “Numeric Functions” in the MDX Function reference for a more complete list). In this example, I’ll assume your dimension aggregates by using SUM:

    SUM(
      EXCEPT(
        [Policy].[Policy Status].[Policy Status],
        {
          [Policy].[Policy Status].&[Void],
          [Policy].[Policy Status].&[Policy]
        }
      ),
      [Measures].[FK Policy Distinct Count]
    )
    

    Here, I have passed the measure to be aggregated as the second parameter to SUM.


    MDX is a complex language which supports many common and uncommon set operations. If you haven’t already, I advise taking the time to read over the documentation available online, or grab yourself a good MDX book. There’s a lot to know 🙂

    <3

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

Sidebar

Related Questions

i want create Dynamic Slideshow in Jquery i'm Write this code var ctx =
I have created a calculated member that assigns customer type. The problem is that
I want to create a calculated field that multiply column1 and column2 on rails
I'm trying to create a thumbnail of an image, for example, this one: I
I want create a query that creates a calculated field ANSWER_SCORE which it then
I want to create a calculated column that returns YES if the four columns
I am trying to create a calculated column in SharePoint 2007. I want it
i want create multiple search where statement $where_search is a multiple condition from post
I want create wordpress website into which I want create user management... That means
i want create a custom json data from the mssql 2008 results so that

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.