Something like this might work for you.
q)tables[]
`positions`quote`trade
q)count each flip trade
time | 40000
sym | 40000
src | 40000
price | 40000
amount| 40000
side | 40000
You can run the same thing on partitioned data as well.
q)count each flip select from ohlc where date=last date
date | 1440
sym | 1440
exchange | 1440
timestamp| 1440
open | 1440
high | 1440
low | 1440
close | 1440
volume | 1440
EDIT: The methods used above will only work on tables which are not corrupted, which may not be best suited to your use case.
If the data is corrupted, you can get
each column from its location on disk and count it.
q)cols[ohlc]!{count get hsym`$"/path/to/hdb/2020.02.09/ohlc/",string x}each cols ohlc
date | 1440
sym | 1440
date | 1440
exchange | 1440
timestamp| 1439
open | 1440
high | 1440
low | 1440
close | 1440
volume | 1440