Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with MDX query: count of those in contract

Status
Not open for further replies.

voirin

Technical User
May 15, 2003
29
0
0
AU
Hi everyone. I was hoping someone might have some insight into a particular query Im trying to generate.

Essentially I have a table that looks like the following:

clientID startDate endDate
1 12/1/2001 12/2/2003
2 16/2/2002 23/3/2002
3 2/3/2001 23/8/2005
.....


I have a date dimension table filled with values ranging from 1/1/2000 to 31/12/2008 incremented by 1 day

I need to create a measure (call it CountofThoseInContract) which is a basic count of those members in contract on a specified date. For example, if i specify the date:

date = 10/2/2001
CountofThoseInContract = 1

date = 20/5/2002
CountofThoseInContract = 3

... based on the above date.

The SQL query for this will be:

select count(*) from contractTable c
where date between c.startDate and c.endDate

I just cant seem to find how I can generate the same measure within olap.

Any help really appreciated!

Cheers,
Cathy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top