Hi,
I am trying to build a transformation process in TX based on the following SQL code.
------------------------------------------
SELECT distinct
[BusinessEntityID]
,B.MonthKey
,[StartDate]
,[EndDate]
,[DepartmentName]
FROM [TX_DSA].[dbo].[EmployeeDepartmentHistory] A
join dbo.Calendar B ON B.Date >= A.StartDate
where b.DateValue >= a.StartDate AND (a.EndDate is null or a.EndDate <= b.DateValue)
----------------------------------------------------
I want intentionally to expand the grain of table A. I tried different Joins and conditional lookups but I just can't reproduce the output.
How would you solve this?
Thanks in advance
gr
Jose
Best answer by Thomas Lind
View original