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

  • Home
  • SEARCH
  • 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 55845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:26:28+00:00 2026-05-10T17:26:28+00:00

I need to define a calculated member in MDX (this is SAS OLAP, but

  • 0

I need to define a calculated member in MDX (this is SAS OLAP, but I’d appreciate answers from people who work with different OLAP implementations anyway).

The new measure’s value should be calculated from an existing measure by applying an additional filter condition. I suppose it will be clearer with an example:

  • Existing measure: ‘Total traffic’
  • Existing dimension: ‘Direction’ (‘In’ or ‘Out’)
  • I need to create a calculated member ‘Incoming traffic’, which equals ‘Total traffic’ with an additional filter (Direction = ‘In’)

The problem is that I don’t know MDX and I’m on a very tight schedule (so sorry for a newbie question). The best I could come up with is:

([Measures].[Total traffic], [Direction].[(All)].[In]) 

Which almost works, except for cells with specific direction:

example

So it looks like the ‘intrinsic’ filter on Direction is overridden with my own filter). I need an intersection of the ‘intrinsic’ filter and my own. My gut feeling was that it has to do with Intersecting [Direction].[(All)].[In] with the intrinsic coords of the cell being evaluated, but it’s hard to know what I need without first reading up on the subject 🙂

[update] I ended up with

IIF([Direction].currentMember = [Direction].[(All)].[Out],     0,     ([Measures].[Total traffic], [Direction].[(All)].[In]) ) 

..but at least in SAS OLAP this causes extra queries to be performed (to calculate the value for [in]) to the underlying data set, so I didn’t use it in the end.

  • 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-10T17:26:29+00:00Added an answer on May 10, 2026 at 5:26 pm

    To begin with, you can define a new calculated measure in your MDX, and tell it to use the value of another measure, but with a filter applied:

    WITH MEMBER [Measures].[Incoming Traffic] AS '([Measures].[Total traffic], [Direction].[(All)].[In])' 

    Whenever you show the new measure on a report, it will behave as if it has a filter of ‘Direction > In’ on it, regardless of whether the Direction dimension is used at all.

    But in your case, you WANT the Direction dimension to take precendence when used….so things get a little messy. You will have to detect if this dimension is in use, and act accordingly:

    WITH MEMBER [Measures].[Incoming Traffic] AS 'IIF([Direction].currentMember = [Direction].[(All)].[Out],     ([Measures].[Total traffic]),     ([Measures].[Total traffic], [Directon].[(All)].[In]) )' 

    To see if the Dimension is in use, we check if the current cell is using OUT. If so we can return Total Traffic as it is. If not, we can tell it to use IN in our tuple.

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

Sidebar

Ask A Question

Stats

  • Questions 58k
  • Answers 58k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer DDD is an area where I have a lot of… May 11, 2026 at 8:46 am
  • added an answer This can be done using custom XML. I ran the… May 11, 2026 at 8:46 am
  • added an answer This solution worked for the task at hand so to… May 11, 2026 at 8:46 am

Related Questions

No related questions found

Top Members

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

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.