DimDateUpdates
 DimDateUpdates (Integration Services Package)
  Workflow Screenshot
  Properties
Property Value
Name DimDateUpdates
Description This package will update the information used for the Financial Dashbaord based on the CurrentDayDate variable.
Checkpoint File Name
Checkpoint Usage Never
Check Signature On Load True
Creation Date Tuesday, May 08, 2012 4:11 PM
Creator Computer Name scowan
Creator Name scowan\hetgroup
Debug Mode False
Delay Validation False
Disable False
Disable Event Handlers False
Enable Configurations True
Encrypt Checkpoints False
Fail Package On Failure False
Fail Parent On Failure False
Forced Execution Value 0
Force Execution Value None
Description False
ID 6783aed0-3150-41a8-b69a-8217bcd5360b
Interactive Mode False
Is Default Locale ID False
Isolation Level Serializable
Locale ID 1033
Logging Mode Enabled
Max Concurrent Executables -1
Maximum Error Count 1
Offline Mode False
Package Type DTSDesigner100
Protection Level EncryptSensitiveWithUserKey
Save Checkpoints False
Suppress Configuration Warnings False
Suspend Required False
Transaction Option Supported
Update Objects False
Version Build 288
Version Comments
Version Guid cb1959ab-52ee-489b-bc88-eff1275510b0
Version Major 1
Version Minor 0
  Executables
Name Type Description
Task
Execute SQL Task
  Connection Managers
Name Description
  Log Providers
Name Description
  User Defined Variables
Name Value Expression Description
2016-03-04
This variable is set to the current date if the ETL process is executed after 6 am. If the ETL is executed prior to 6 am, it will be set to yesterday?s date. This variable will be used to extract the Enrollment information for that date. If the UseManualDates is set to Y, this variable will not be updated.
EnterpriseDW
N/A
DECLARE @CurrentDay date = '2016-03-04' DECLARE @FiscalYear varchar(7) DECLARE @FiscalYearStart varchar(7) DECLARE @Year int DECLARE @TempDate date SET @Year = YEAR(@CurrentDay) SET @TempDate = ( CASE WHEN MONTH(@CurrentDay) = 7 THEN DATEADD(mm, -1,@CurrentDay) ELSE @CurrentDay END ) -- If we are in July, set the Fiscal Year to prior Fiscal Year since it is the last closed period SET @FiscalYear = (SELECT FiscalYear FROM [EnterpriseDW].[dbo].[DimDate] WHERE FullDate = @TempDate) SET @Year = CAST(SUBSTRING(@FiscalYear,4,4) as int) SET @Year = @Year - 15 SET @FiscalYearStart = 'FY' + ' ' + CAST(@Year as varchar(4)) UPDATE [EnterpriseDW].[dbo].[DimDate] SET [IsCurrentFiscalYear] = ( CASE WHEN FiscalYear <> @FiscalYear THEN 'N' ELSE 'Y' END ) FROM [DimDate] UPDATE [EnterpriseDW].[dbo].[DimDate] SET [IsAvailableForFinance] = 'Y' FROM [DimDate] WHERE FiscalYear >= @FiscalYearStart and FiscalYear <= @FiscalYear UPDATE [EnterpriseDW].[dbo].[DimDate] SET [CalendarPeriodSort] = (CASE WHEN ( MONTH(@CurrentDay) > 6 AND Year(DATEADD(yy, 1,@CurrentDay)) = CAST(RIGHT(FiscalYear,4) AS Int) OR Year(@CurrentDay) = CAST(RIGHT(FiscalYear,4) AS Int) ) AND MONTH(DATEADD(mm, -1,@CurrentDay)) = MonthOfYear THEN 1000000 + CalendarPeriod WHEN ( MONTH(@CurrentDay) > 6 AND Year(DATEADD(yy, 1,@CurrentDay)) <> CAST(RIGHT(FiscalYear,4) AS Int) OR Year(@CurrentDay) <> CAST(RIGHT(FiscalYear,4) AS Int) ) AND 6 = MonthOfYear THEN 1000000 + CalendarPeriod ELSE 2000000 + CalendarPeriod END ) --Set IsCurrentDay to match value in DWOperations.dbo.[SSIS Configurations] Var_CurrentDayDate --(This is passed in to package using pacakge configurations) UPDATE dbo.DimDate SET IsCurrentDay = 'N' WHERE IsCurrentDay = 'Y' UPDATE dbo.DimDate SET IsCurrentDay = 'Y' WHERE FullDate = @CurrentDay
"DECLARE @CurrentDay date = '" +@[User::CurrentDayDate] + "' DECLARE @FiscalYear varchar(7) DECLARE @FiscalYearStart varchar(7) DECLARE @Year int DECLARE @TempDate date SET @Year = YEAR(@CurrentDay) SET @TempDate = ( CASE WHEN MONTH(@CurrentDay) = 7 THEN DATEADD(mm, -1,@CurrentDay) ELSE @CurrentDay END ) -- If we are in July, set the Fiscal Year to prior Fiscal Year since it is the last closed period SET @FiscalYear = (SELECT FiscalYear FROM " + (@[User::EDWLinkedServerName] == "N/A" ? "" : "[" + @[User::EDWLinkedServerName]+"]." ) + "["+ @[User::EDWDBName] + "].[dbo].[DimDate] WHERE FullDate = @TempDate) SET @Year = CAST(SUBSTRING(@FiscalYear,4,4) as int) SET @Year = @Year - 15 SET @FiscalYearStart = 'FY' + ' ' + CAST(@Year as varchar(4)) UPDATE " + (@[User::EDWLinkedServerName] == "N/A" ? "" : "[" + @[User::EDWLinkedServerName]+"]." ) + "["+ @[User::EDWDBName] + "].[dbo].[DimDate] SET [IsCurrentFiscalYear] = ( CASE WHEN FiscalYear <
This is the variable that contains the SQL statement that is used to update DimDate dimension table with the correct information based on the CurrentDayDate variable.
  System Variables
Name Value Expression Description
Powered by BI Documenter