How to filter field with count in datatable

I have field state which has 2 values "BEGIN" and "END", I want to show count when state is "BEGIN" so I've tried

{
  "query": {
    "match_phrase": {
      "state": "BEGIN"
    }
  }
}

but nothing works, any idea how to do this. Thanks :smiley:
image

Hi @tungpzostar,

I'd first create a viz that shows count for all states (just leave metric configuration as you've showed on a screenshot) and then I'd use filter bar to filter only by state:begin:

Screenshot 2020-12-03 at 14.09.12 Screenshot 2020-12-03 at 14.09.19

If you'd do similar to my example, you'd I just have state: BEGIN/END instead of mine cancelled: true/false

I can filter out state: BEGIN but can I do count BEGIN, count END in one data table. Thanks :smiley:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.