I have a cube with few dimensions. Report Date and Account are two of them. One account id may come under multiple Report dates. I need to find minimum report date for every accountid. Any ideas?
0
votes
1 Answers
0
votes
Maybe something similar -
WITH SET[MinDate] AS
Head(NonEmpty(
ReportDate.[ReportDate].[ReportDate].MEMBERS,
{(EXISTING [Account].[AccountId].CurrentMember , [Measures].[foo])}
),1)
SELECT [MinDate] ON 1,
[Account].[AccountId].MEMBERS ON 0
FROM [bar]
WHERE [Measures].[foo]
If what you want is the minimum date's value, then you would need to get that in a calculated measure instead of a set.
WITH MEMBER Measures.[MinimumDate] AS
Head(NonEmpty(
ReportDate.[ReportDate].[ReportDate].MEMBERS,
{(EXISTING [Account].[AccountId].CurrentMember , [Measures].[foo])}
),1).ITEM(0).Name