Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Analysis Server and Reporting Services (2012)
 MDX calculation for two dates

Author  Topic 

cidr
Posting Yak Master

207 Posts

Posted - 2013-11-04 : 17:00:16
Hi there,

I've been working on this for a couple of days and hope someone can help.

To keep it simple, I have a Dimension table - Enrolment - that holds records on employees that have joined a pension scheme.

Each employee has a StartDate and a CancellationDate or the cancellationDate may be null.

Using a date slicer (dim date or dummy date) I want to return all employees that have a StartDate that is before the selected date and a cancellationDate that is after the date or the CancellationDate is null (in which case, this will be counted.

I have an Enrolment Dimension in the cube and a measure that is (Enrolment count). I'll be using this measure to return the count of employees.

I want to create an MDX function or similar to perform this.

Any help would be much appreciated.
   

- Advertisement -