Link to home
Start Free TrialLog in
Avatar of starrynighter
starrynighter

asked on

Analysis services - MDX date calculation

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
Avatar of arbert
arbert

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.
ASKER CERTIFIED SOLUTION
Avatar of arbert
arbert

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of starrynighter

ASKER


Thanks both.
Thanks both.