?
Solved

Analysis services - MDX date calculation

Posted on 2004-04-07
5
Medium Priority
?
2,690 Views
Last Modified: 2012-08-13
Please advise if I'm in the wrong area to ask this.

I want to make a calculated member "age of employee" based on a dimension attribute
Employee.birth_date

Iimagine this would be something like

truncate( NOW() - Employee.birth_date )

IF MDX does date arithmetic !
Does it? and if so what syntax works?

Otherwise I have read a way ( media.wiley.com/product_data/excerpt/ 67/04714004/0471400467.pdf  dated June 2001)
to do this calling VBA!DateDiff
0
Comment
Question by:starrynighter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 34

Expert Comment

by:arbert
ID: 10780563
We've always taken the route of using DATEDIFF--more robust and you can keep errors from popping up if bad data appears....
0
 
LVL 2

Expert Comment

by:eric_duncan
ID: 10780661
Note that you can use the DATEDIFF function that is intrinsic to TSQL, rather than the VBA one.
0
 
LVL 34

Accepted Solution

by:
arbert earned 520 total points
ID: 10780671
Right all depends on if there are any additional checks you want to perform.  Although, you can perform about the same functions in TSQL.  We already had VBA 'routines' that we were using from other systems though....
0
 

Author Comment

by:starrynighter
ID: 10837246

Thanks both.
0
 

Author Comment

by:starrynighter
ID: 10837907
Thanks both.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question