Filter löschen
Filter löschen

inner join with a conditional statement

1 Ansicht (letzte 30 Tage)
wesso Dadoyan
wesso Dadoyan am 4 Okt. 2017
Bearbeitet: Walter Roberson am 4 Okt. 2017
Hi,
I have an id that could pertain to two different companies depending on the date of the observation. For example id=1 could pertain to firm A between 1990 and 2000 and pertain to firm B between 2001 and 2016. Usually I can run a simple code to link two tables based on id:
Data=innerjoin(Data1,Data2, 'Keys', {'id'});
if id is unique to each firm. But since id is not unique , how can i modify the codes to include a conditional statement about dates. For instance i want to say the following:
Data=innerjoin(Data1,Data2, 'Keys', {'id'});
where the id selected is the one where the date column in Data1 table (Date0) falls between Dates1 and Dates2 columns in table Data2

Antworten (0)

Kategorien

Mehr zu Financial Toolbox finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by