Friday, February 17, 2012

Differences IN AS 2000 and AS 2005

Hi,

I just wanted to know if I can replicate a particular thing that I was able to do in AS 2000 very easily in AS 2005.

Basically I used to define a time dimension in AS 2000 which was basically a single column and was able to split it into 3 levels Year,Quarter and Month using the functinality provided by AS 2000.

Can I do something similar in AS 2005 because the options that I see in order to define a time hierarchy needs me to pick 3 different columns for each time level or hierarchy.

Thanks

There is a new "Server Time Dimension" option that allows you to build a time dimension simply by entering a begin and end date. If you want to control the exact format of how the level members work you can always create a "named query" in the data source view using the date from your fact table and T-SQL date functions to format the level members. The feature you are referring to is no longer available in 2005. Here is an example of a query using a table from the "AdventureWorks" database that demonstrates how you could do this using a named query:

USE [AdventureWorks]

GO

SELECT DISTINCT

OrderDate,

DatePart(year,OrderDate) AS [Year],

'Q' + DateName(quarter,OrderDate) + '-' + Right(DatePart(year,OrderDate),2) AS [Quarter],

Left(DateName(month,OrderDate),3) + '-' + Right(DatePart(year,OrderDate),2) AS [Month],

Right('0' + DateName(day,OrderDate),2) + '-' + Left(DateName(month,OrderDate),3) + '-' + Right(DatePart(year,OrderDate),2) AS [Day]

FROM

Sales.SalesOrderHeader

ORDER BY 1

GO

HTH,

Steve

No comments:

Post a Comment