Search code examples
kdb

Date range for backfill between two dates in q kdb


I want to backfill from a particular date to the latest date(say last working day).
Considering I have total 671 partitions

count .Q.pv / 671j

And we need to backfill for last 10 days

{//backfill function; 0n!x}@'660 11 sublist .Q.pv

Is there any other/better way to provide partition dates to backfill function other then using sublist.


Solution

  • You can use -10#date to get last 10 dates in your hdb.

    Another "safer" option would be to use sublist as this will work in the occurrence of you having less than 10 dates in your hdb: -10 sublist date