# Kibana dashboard filters that recognize multiple views?

**URL:** <https://discuss.elastic.co/t/kibana-dashboard-filters-that-recognize-multiple-views/333507>\
**Category:** Kibana\
**Created:** [May 15, 2023, 9:41pm UTC](https://discuss.elastic.co/t/kibana-dashboard-filters-that-recognize-multiple-views/333507 "2023-05-15T21:41:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![learningelastic](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@learningelastic](https://discuss.elastic.co/u/learningelastic)\
**Post date:** [May 15, 2023, 9:41pm UTC](https://discuss.elastic.co/t/kibana-dashboard-filters-that-recognize-multiple-views/333507/1 "2023-05-15T21:41:27Z")

</div>

I created a dashboard that shows visualizations . Each visualization references a different Kibana data view. And each kibana data view references a different index.

For example, let's say I have two indices with the following mappings:

```auto
timesheet: project_id, assignment_id, billable_hours
cost_estimate: project_id, assignment_id, dollar_amount

```

Then I made two Kibana views that have the same name as the indices and also use the same mappings.

Then I went to Kibana dashboards and made a few visualizations. For example:

```auto
Bar Graph with X-Axis showing timesheet.assignment_id and Y-Axis showing SUM(timesheet.billable_hours)
Bar Graph with X-Axis showing cost_estimate.assignment_id and Y-Axis showing SUM(cost_estimate.dollar_amount)

```

Then I went back to my dashboard to see all the visualizations. Then I went to this filter:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1a05774b308d7ed0be147f09a6de110914846756.png)

And I tried to make this expression

```auto
timesheet.project_id == 2012 OR cost_estimate.project_id == 2012

```

But Kibana will only accept ONE of either `timesheet.project_id == 2012` (as shown in red highlight) OR `cost_estimate.project_id == 2012` (as shown in purple highlight)

How do I make an OR statement across both data views? Is it even possible

If not, how would I go about having a dashboard that can do something similar? As a last resort, I could have one index like this:

```auto
content: project_id, assignment_id, content_type, billable_hours, dollar_amount

```

Where the field `content_type` can be the value `timesheet` or `cost_estimate`.

---

<div class="post-metadata">

**Author:** ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)\
**Post date:** [May 16, 2023, 8:10am UTC](https://discuss.elastic.co/t/kibana-dashboard-filters-that-recognize-multiple-views/333507/2 "2023-05-16T08:10:13Z")

</div>

Yeah each filter is associated with a dataview so you won't be able to do it, only if you have all fields to one dataview.

---

<div class="post-metadata">

**Author:** ![jughosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jughosta/32/107160_2.png) [@jughosta](https://discuss.elastic.co/u/jughosta)\
**Post date:** [May 16, 2023, 12:32pm UTC](https://discuss.elastic.co/t/kibana-dashboard-filters-that-recognize-multiple-views/333507/3 "2023-05-16T12:32:26Z")

</div>

Hi @learningelastic,

It's not possible inside filters UI but there are some other options as Stratoula mentioned:

1. Create a data view which targets both indices at once instead of 2 data views per index. It can be achieved by entering an index pattern like the following `timesheet,cost_estimate`. Then it would be possible to build a single filter for `project_id` field for such combined data view.

2. Or make use of KQL search input with `AND`/`OR` logic. But in this case you would need to use index name instead of a data view name. Example of a query across 2 different indices and data views:

---

<div class="post-metadata">

**Author:** ![learningelastic](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@learningelastic](https://discuss.elastic.co/u/learningelastic)\
**Post date:** [May 16, 2023, 5:52pm UTC](https://discuss.elastic.co/t/kibana-dashboard-filters-that-recognize-multiple-views/333507/4 "2023-05-16T17:52:20Z")

</div>

Thanks you

For your suggestion 2, I see the query

```auto
_index: "kibana_sample_data_flights" AND DestCityName: "Barcelona" or extension.keyword: "css"

```

If I understand correctly, the `[Flights] Flight Log` is a visualization that references the index `kibana_sample_data_flight` directly and doesn't use a Kibana Data View? Or does the `[Flights] Flight Log` also use a Kibana Data View that references the `kibana_sample_data_flight` directly? Or does that matter? Trying to understand meaning/consequences of mixing and matching of views and indices in queries like these

---

<div class="post-metadata">

**Author:** ![jughosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jughosta/32/107160_2.png) [@jughosta](https://discuss.elastic.co/u/jughosta)\
**Post date:** [May 16, 2023, 6:31pm UTC](https://discuss.elastic.co/t/kibana-dashboard-filters-that-recognize-multiple-views/333507/5 "2023-05-16T18:31:01Z")

</div>

It was an example of using `AND`/`OR` logic together with `_index` (index name) to filter out some results if necessary. `_index` part can be also skipped of course.

`[Flights] Flight Log` is a saved search from Discover page. It uses `Kibana Sample Data Flights` data view which targets `kibana_sample_data_flight` index. And `[Logs] Visits` uses `Kibana Sample Data Logs` data view in this case.

---

<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:** [June 13, 2023, 6:31pm UTC](https://discuss.elastic.co/t/kibana-dashboard-filters-that-recognize-multiple-views/333507/6 "2023-06-13T18:31:34Z")

</div>

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