Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
vaibhav11
Contributor
Contributor

Matching 2 columns and deriving third column from other table

HI,

I  have a scenario where i have below details in as Fact table:

SalesorderID|TerritoryID||Orderdate

and another table with below details:

TerritoryID|SalespersonID|StartDate|Enddate

this second table shows each SalespersonID with history data for each territory he has lived in and is currently associated to,

as in if the End date is nulll that means at the current time he is a salesperson of this territory  or for the previous period,he was a salesperson of this territory

i have to finally check the SalespersonID  associated with each SalesOrderID

based on the conditions as :

for each territoryID and salesorderID in the first table , if  for that territory obtained from first table,the orderdate lies between Start date and End Date,the corrresponfing SalespersonID is  what the salesperson for that time is.


Can  any body help me with this?


1 Solution

Accepted Solutions
2 Replies
sunny_talwar

You need Extended Interval Match‌ here

vaibhav11
Contributor
Contributor
Author

Thanks Sunny!! it worked