Azzera filtri
Azzera filtri

inner join with a conditional statement

1 visualizzazione (ultimi 30 giorni)
wesso Dadoyan
wesso Dadoyan il 4 Ott 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

Risposte (0)

Categorie

Scopri di più su Financial Toolbox in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by