Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2695
  • Last Modified:

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
0
starrynighter
Asked:
starrynighter
  • 2
  • 2
1 Solution
 
arbertCommented:
We've always taken the route of using DATEDIFF--more robust and you can keep errors from popping up if bad data appears....
0
 
eric_duncanCommented:
Note that you can use the DATEDIFF function that is intrinsic to TSQL, rather than the VBA one.
0
 
arbertCommented:
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
 
starrynighterAuthor Commented:

Thanks both.
0
 
starrynighterAuthor Commented:
Thanks both.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now