Overlay Target KPI line over bar graph?

We are importing our bookings into ES into a bookingIndex for each day.

A booking contains an ID, startDate, finishDate, duration, department, status, etc..

This is working nicely, I can use Kibana to show hours per status per department, per day, etc… on a bar chart.

Each department is targeted with covering a certain number of hours per day/week, etc..
so i would like to overlay a line to show the department targets….

The targets are stored in our db, so i can extract them, just not sure how to import them into ES
and merge into bookingsIndex? I know i can add an additional metric and Y axis, but just not sure on the correct data to store.

for example,
booking ID 1, department 1, duration: 10, startDate: 19/06/2019 08:00, finishDate: 19/06/2019 18:00, status: Covered.

department 1 may be targeted with covered 100 hours today, 120 tomorrow, etc.

what's the best way to structure my index and data?

any one got any idea or point me in the right direction of any examples?

Hmm, you might be able to just index them in the same index, with some format like

{ "department": 1, "startDate": "19/06/2019 08:00", "duration": 100, "target": true }

Then, in your visualization, you'll want to create at the top level, a "filters" aggregation, and have one of the filters be something like _exists_:"target", then another that is !_exists_:"target". Basically this will create two top-level series: One for your targets, then your other for your actual data.

Here's a screenshot of what it might look like:

Happy to assist if you have questions on how to accomplish this.

that's great, thanks. I'll give it a go.

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