Search code examples
kdb

Count from KDB table with where clause


I know count table tells you how many rows are in table but how do you count from a table with a where clause as a filter? I tried count table where PERIOD=x but I am getting the error: 'PERIOD even though PERIOD is a field in the table


Solution

  • Use qsql to filter and then count the result:

      count select from table where PERIOD=x