Solved

Analysis services - MDX date calculation

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now