Solved

Analysis services - MDX date calculation

Posted on 2004-04-07
5
2,688 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 130 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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

695 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