SSAS Articles Time Dimension Generate date dimension that support working days calculation
Generate date dimension that support working days calculation
User Rating: / 0
PoorBest 
Written by Marco Russo   
Tuesday, 27 November 2007 17:12

SQL Server code to generate date dimension table that supports working days calculation.

I just wrote a T-SQL query based on CTE that generates support information to calculate working days in a period. Simply look at the WorkingDaySequential measure, which difference between two dates is the number of elapsed working days.

In the real world:

  • The Holidays CTE could be replaced by a real table with user-inserted data.
  • The temporary [#Calendar] could be a real table, providing necessary data access from DM

and probably much else.

The following code is provided "as is", without any warranty about its behavior.

 

 

Read more...