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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PeriodsToDate help 1

Status
Not open for further replies.

PerlIsGood

Programmer
Jan 24, 2002
154
US
I have a query that works when I feed it a specific date, but can't seem to get it to work using variable select (LastChild, etc). Trying to create two subsets one for Current YTD and one for Last YTD (ie 1-2008 to 8-2008, and 1-2007 to 8-2007, based on the last date currently in dataset)

Any advice is welcome.

Code:
with member [ChangeMonthsIncDec].[YrMonth].[YTD LY] as 
		Aggregate(
			PeriodsToDate(
				[ChangeMonthsIncDec].[Year -  Month].[Year]
				,[ChangeMonthsIncDec].[Year -  Month].[Month].[b]&[200708][/b]
			)
		)
select {
		[Measures].[Num Line Increases]
		,[Measures].[Avg New Line Size]
		,[Measures].[Avg Prev Line Size]
	} on columns,
	{
		[ChangeMonthsIncDec].[YrMonth].[YTD LY]
		,[ChangeMonthsIncDec].[YrMonth].[YrMonth]
	} on rows
from [PerformanceAtLineIncrease]

Notorious P.I.G.
 
Is this a SSAS Cube?

Paul
---------------------------------------
Shoot Me! Shoot Me NOW!!!
- Daffy Duck
 
check out this thread in the SSAS Forum

thread960-1488889

Paul
---------------------------------------
Shoot Me! Shoot Me NOW!!!
- Daffy Duck
 
Thanks Paul! Didn't see the AS forums, just what I was looking for.

Notorious P.I.G.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top