# Filtering different visualizations in the same dashboard differently

**URL:** https://discuss.elastic.co/t/filtering-different-visualizations-in-the-same-dashboard-differently/239477
**Category:** Kibana
**Created:** [July 1, 2020, 11:53am UTC](https://discuss.elastic.co/t/filtering-different-visualizations-in-the-same-dashboard-differently/239477 "2020-07-01T11:53:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Reuven\_Weiser](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/reuven_weiser/32/58010_2.png) [@Reuven\_Weiser](https://discuss.elastic.co/u/Reuven_Weiser)
#### Post date: [July 1, 2020, 11:53am UTC](https://discuss.elastic.co/t/filtering-different-visualizations-in-the-same-dashboard-differently/239477/1 "2020-07-01T11:53:19Z")

</div>

Assume I have an index of employees, each with a sub-object representing their manager:

```auto
{
	"document-id": "XYZ",
	"firstName": "John",
	"lastName": "Smith",
	"office": "midtown",
	"manager": {
		"document-id": "ABC",
		"firstName": "Sue",
		"lastName": "Smith",
		"office": "downtown"
	}
}

```

I want a dashboard with two metrics - the number of employees, and the number of managers. Easy enough - create one Metric visualization with a simple Count of documents in the index, and another Metric visualization with a Unique Count of manager.document-id.

But now what if I want to be able to filter my dashboard by "office", to see how many employees and managers I have in each office? I can't create a simple dropdown, because one Metric needs to filter based on "office", while the other needs to filter based on "manager.office".

Is there a way to do this - to have a filter apply differently to the different visualizations in a single dashboard? Perhaps some sort of parameterized visualization?

I'm using Kibana 7.4.2.  
And assume that it is not feasible to create another index of _just_ managers. Both of these entities are actually much more complicated, with many more sub-objects, than I'm representing here, so creating even _more_ indexes with such [duplicated] complexity seems inadvisable.

Thanks!

---

<div class="post-metadata">

### Author: ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)
#### Post date: [July 15, 2020, 2:18pm UTC](https://discuss.elastic.co/t/filtering-different-visualizations-in-the-same-dashboard-differently/239477/2 "2020-07-15T14:18:01Z")

</div>

I see two things:

- On one hand Kibana understands **filters** as a composition `and` logical conditions.
- Even if you could reindex your data to have a new field with the two values, unfortunately, Kibana does not support nested fields ([reported issue](https://github.com/elastic/kibana/issues/58175)), so no widget can operate on that type of data.

At this moment I'd say you need to use the Kibana bar to execute the `or` operation.

@flash1293 any other ideas?, please correct me if I'm wrong.

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [July 15, 2020, 3:33pm UTC](https://discuss.elastic.co/t/filtering-different-visualizations-in-the-same-dashboard-differently/239477/3 "2020-07-15T15:33:56Z")

</div>

I think even an `or` query wouldn't help here, because it would count employees if just the manager is located in an office and vice versa.

Splitting up this index into a manager index and an employee index indeed seems like the "right" approach here.

If it's not necessary to dynamically choose the office, you can also add the respective filters to individual visualizations ("number of employees in location X", "number of managers in location X", "number of employees in location Y", "number of managers in location Y")

---

<div class="post-metadata">

### Author: ![Reuven\_Weiser](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/reuven_weiser/32/58010_2.png) [@Reuven\_Weiser](https://discuss.elastic.co/u/Reuven_Weiser)
#### Post date: [August 6, 2020, 10:20am UTC](https://discuss.elastic.co/t/filtering-different-visualizations-in-the-same-dashboard-differently/239477/4 "2020-08-06T10:20:40Z")

</div>

Thanks. Not quite the answer I was hoping for, but at least it's good to know I'm not missing some way to simplify things.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 3, 2020, 10:20am UTC](https://discuss.elastic.co/t/filtering-different-visualizations-in-the-same-dashboard-differently/239477/5 "2020-09-03T10:20:41Z")

</div>

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