필터 지우기
필터 지우기

inner join with a conditional statement

조회 수: 1 (최근 30일)
wesso Dadoyan
wesso Dadoyan 2017년 10월 4일
편집: Walter Roberson 2017년 10월 4일
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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Financial Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by