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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:37:55+00:00 2026-06-13T06:37:55+00:00

I am quite new to MDX and I need to write a query that

  • 0

I am quite new to MDX and I need to write a query that gives me the day difference between two dates. The problem is that the dates exist on two different rows in my data. For example:

My Fact table:

SEAL | STARTDATE | PROCESS | FK_DATE_KEY  
1    | 2012-10-22|    A    | 20121022
1    | 2012-10-24|    B    | 20121024
2    | 2012-10-22|    A    | 20121022
2    | 2012-10-26|    B    | 20121026

What I need returned is :

SEAL | AGE_IN_DAYS
1    |      2
2    |      4

Please help…. I have a date dimension that relates to my FK_DATE_KEY

  • 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-06-13T06:37:56+00:00Added an answer on June 13, 2026 at 6:37 am

    If you are new to MDX, you shouldn’t try to do this problem using only MDX. This particular problem is much easier if you write it under SQL and use that data in your Analysis Services.

    So, the easiest and nicest way to do this problem is to write a view which returns the same data you gave in your question. (SEAL | AGE_IN_DAYS)
    Then you are able to insert these data in your Data Source View (if you choose ‘new named query’, you can fetch table-valued functions too, not only views and tables)

    Hope it helps!

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

Sidebar

Related Questions

I'm quite new to MDX and im having some trouble getting the following t-sql
Im quite new to Java and i have stumbled upon the following problem. Im
I'm quite new to that functional programming paradigm, but so far I like it.
Im quite new to doctrine2. I need to make a connection like this: Tag
Im quite new in Scala. I need to get the parametrization of a class.
Quite new to this but i have created a SQL script that groups by
Quite new to RIA Services but i am progressing... I noticed that some methods
I quite new with CMake, but I have a problem with porting an existing
quite new to JQuery and Ive run into a problem. I have a form
Im quite new to xslt transforms and I need help with one kind of

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.