Sunday, August 28, 2016

kdb group by weekday, hour

select count i by weekday:-1+`int$date mod 7, "n"$0D01:00:00.0 xbar date+time from table

Note: 

  1. `int$date cast date to the number of days since year 2000
  2. by hour can be done with time.hh, but the above will actually return a time column instead of int column

No comments:

Post a Comment