Kibana Vega - How to display multiple results in a date histogram

I am wonder if it is possible to display more than one aggregated result in a date histogram?

My Vega query is

{
  $schema: https://vega.github.io/schema/vega-lite/v2.json
  title: Daily Count

  data: {
    url: {
      %context%: true
      %timefield%: @timestamp
      index: my_index
      body: {
        size: 0      
        aggs: {
          time_buckets: {
            date_histogram: {
              field: @timestamp
              calendar_interval: day
              min_doc_count: 0
            }
            aggs: {
              a_call_sum: {
                sum: {
                  field: a_call
                }
              }
              e_call_sum: {
                sum: {
                  field: e_call
                }
              }
            }
          }
        }
      }
    }
    format: {property: "aggregations.time_buckets.buckets"}
  }
  
  mark: bar
  
  encoding: {
    x: {
      field: key
      type: temporal
      axis: {title: false}
    }
    y: {
      field: a_call_sum.value
      type: quantitative
      axis: {title: "Call count"}
    }
  }
}

I was wondering if it is possible to display both a_call_sum and e_call_sum in the same visual side by side in their respective bin/interval or maybe I am using the wrong visual type?

Hi @Amphagory!

This Discuss post looks similar to your request.

Have you looked into using flatten transform? Another option might be to use composite aggregation.

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