SanMu
SanMu

Reputation: 765

KDB - query day by day and join results together

I have a relatively small table (t1) and want to join a large time series (t2) with it through an as-of-join. The timeseries is too large to do it in one go so I want to split the operation up into daily chunks.

Given a list of dates, I want to execute the same query for each date:

    aj[`Id`Timestamp;select from t1 where date=some_date;select from t2 where date=some_date]

Ideally this should return a list of tables l so that I can simply join them:

l[0] uj/ 1_l

Upvotes: 0

Views: 438

Answers (1)

terrylynch
terrylynch

Reputation: 13572

I believe something like this should work:

raze{aj[`Id`Timestamp;select from t1 where date=x;select from t2 where date=x]
 }each exec distinct date from t1

Upvotes: 1

Related Questions