Solved

Analysis services - MDX date calculation

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

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.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

739 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