.Q.ind[x;y]
Where
x is a partitioned tabley is a long int vector of row indexes into xreturns rows y from x.
When picking individual records from an in-memory table you can simply use the special virtual field i:
select from table where i<100
But you cannot do that directly for a partitioned table.
.Q.ind comes to the rescue here, it takes a table and indexes into the table – and returns the
appropriate rows.
.Q.ind[trade;2 3]
A more elaborate example that selects all the rows from a date:
q)t:select count i by date from trade
q)count .Q.ind[trade;(exec first sum x from t where date<2010.01.07)+til first exec x from t where date=2010.01.07]
28160313
/ show that this matches the full select for that date
q)(select from trade where date=2010.01.07)~.Q.ind[trade;(exec first sum x from t where date<2010.01.07)+til first exec x from t where date=2010.01.07]
1b