We help IT Professionals succeed at work.

Analysis services - MDX date calculation

starrynighter
on
Medium Priority
2,713 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
Comment
Watch Question

Top Expert 2004

Commented:
We've always taken the route of using DATEDIFF--more robust and you can keep errors from popping up if bad data appears....
Note that you can use the DATEDIFF function that is intrinsic to TSQL, rather than the VBA one.
Top Expert 2004
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:

Thanks both.

Author

Commented:
Thanks both.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.