Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Find Date from SQL Table in Analysis Services Expand / Collapse
Author
Message
Posted Friday, September 27, 2013 7:03 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 28, 2013 7:21 AM
Points: 4, Visits: 19
Hi,

How can I find date from SQL Table in Analysis Services. Like I have Thousand of date in a table 2013-08-13 10:38:39.003, 2012-12-01 45:30:01.009....... and more, How can I add only Years, Months and Dates from those data?

Regards,
Post #1499362
Posted Friday, September 27, 2013 7:23 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 1:38 AM
Points: 13,319, Visits: 10,183
The best approach would be to create a date/time dimension.
Using Date Dimensions for Reporting

Storing the dates as-is in a dimension or fact table is a terrible idea. As you have noticed, it is nearly impossible to do effective analysis on such kind of data. You'll need to split it in a seperate date and time dimension.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1499374
Posted Friday, September 27, 2013 8:08 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 28, 2013 7:21 AM
Points: 4, Visits: 19
Thank you for your reply.
I have Schedule table and Date is a column of the table, which contain Date and time like 2013. 01.10 12:00:13.Now if u plz tell how can I add Year, Month, Day in the cube and/or Dimesion and also how can I fetch/show those in Excel?
Post #1499404
Posted Sunday, September 29, 2013 1:35 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 1:38 AM
Points: 13,319, Visits: 10,183
You need to create another table which stores all the dates between two certain dates.
For example all days between 1900-01-01 and 2050-12-31. You can add extra columns with year, month, quarter info.
Add a foreign key from your schedule table to this data table.

Do the same for time: store every minute of the day in a seperate table: 00:00 till 23:59. Add yet a surrogate key in your schedule table.

Add those two tables as dimensions in SSAS. You will be able to browse them in Excel.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1499769
Posted Wednesday, October 2, 2013 7:40 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 28, 2013 7:21 AM
Points: 4, Visits: 19
okz! thanks a lot :)
Post #1500777
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse