Professional Documents
Culture Documents
How To Load Data From SSAS
How To Load Data From SSAS
Recently I have been working on new data warehouse project using SSAS and SSIS. And I
had to populate the Date dimension table, with granularity at individual day with various
other values like Day of Month, Day of Week, Day Of Quarter, Day Name, Day of Week, Day
of Week in month, First Day of Month, First Day of Quarter etc.
Quickly I did search internet but could not find the script which reasonably satisfy my
requirement. So I have decided write my script as listed below.
This script will populate Date dimension for required as per UK dates like Holidays, Monday
week start day etc. If you need to populate it for USA or other country then you have to
change few things like Holiday Listing, FullDate, Week Start Day etc.
I found one issue while running this script while running on different server. This was
related to First Day of Week. You can check first day of week using @@DATEFIRST. If it
returns 1 then this script will work fine, but if it is other then 1 then you have to change the
script calculation. To get away with this problem I have statement at beginning of this script
to set first day of week to 1 using SET DATEFIRST 1.
Please find the compete script as below. Please let me know if you need any help or if you
feel I have done something wrong in this script.