Borrar filtros
Borrar filtros

inner join with a conditional statement

1 visualización (últimos 30 días)
wesso Dadoyan
wesso Dadoyan el 4 de Oct. de 2017
Editada: Walter Roberson el 4 de Oct. de 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

Respuestas (0)

Categorías

Más información sobre Financial Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by