Hi
We a fact table with 15 000 000 rows with a date, we have to look for information in a date slice in another table.
But this table is not clean and we can have several lines that correspond to the date of the table of fact
Example for the date 15/06/2019
in the table lookup we have :
BEGIN DATE - END DATE
01/06/2019 - 30/06/2019
05/06/2019 - 01/07/2019
10/06/2019 - 02/07/2019
13/06/2019 - 02/07/2019
June 15 matches is well in the slice of these 4 lines.
we would like in this case to recover the most recent begin date
what would be the best practice? with ROW_NUMBER () OVER (PARTITION By ... ORDER BY BEGINDATE DESC, ENDDATE DESC)
and select only numberline = 1?
or is it possible with a script component as ( but with clean lookup table ):
https://kohera.be/blog/sql-server/ssis-boosting-range-lookups-script-component/
Thanks for your helps or advice
Stef