How do I remove the first few rows in a table based on my time column in kdb

Viewed 163

I have a table with columns: time, sum_every_5min, sum_every_10min, and sum_every_20min. How can I condition on time and replace my value in the sum every 5min, sum every 10min, and sum every 20min with NaN?

For example, for the column sum_every_5min, if the time is before 9:30, then all values in that column with time prior to 9:30 will be replaced with NaN. The other two columns remain unchanged.

Any help will be much apprecoated!

Thank you!

1 Answers

This can be done with a qSql update query with a where clause on the time column:

update sum_every_5min:0Nf from t where time < 09:30

Take a look at the kx documentation on qSql:

https://code.kx.com/q4m3/9_Queries_q-sql/

Related