Search code examples
kdb

How do I join a table with a column in kdb


I have a table with column:time for every 3 minutes starting from 14:30 to 16:00. i.e, (14:30;14:33;....;16:00). However, I want my time column to start from 9:30. i.e, (9:30;9:33.....;16:00). I created a new column containing all timestamps I want, however, I am having trouble merging that new column to my dataset. How should I do that?

Thank you!


Solution

  • I am not sure if I get the question right. But as far as I understand you have a table like

    t: ([]time: 14:30+00:03*til 31; val1: 31?1f; val2: 31?10f);
    

    which keeps times from 14:30 to 16:00 and some values.

    If you want to prepend times from 09:30 to 14:30 and fill prepended rows with null values, below query will help:

    ([]time: 09:30+00:03*til 131) lj `time xkey t