Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

Getting the first and last members of a Dynamic Sets

$
0
0

 Hi

I am trying to get the first and last members of a dynamic set. I am able to get the last member but the first member isnt working. I am not sure what I am doing wrong. The query that I am using is given below.

with member Measures.[d1]
as
Head(Existing([Sub Activity Create Date].[Date].Members),1).Item(0).Name
member Measures.[d2]
as
Tail(Existing([Sub Activity Create Date].[Date].Members),1).Item(0).Name
select {Measures.[d1],Measures.[d2]} on columns
from [ACS]
where ([Sub Activity Create Date].[Date].&[20040108]:
[Sub Activity Create Date].[Date].&[20040109])

The result that I get is

d1 d2
All 1/9/2012

I am not sure what I am doing wrong. Please let me know if you have any suggestions.

Thanks

Madhavi


Madhavi Pasapula


Viewing all articles
Browse latest Browse all 2472

Trending Articles