# Drilldown Based on Query Results

**URL:** <https://discuss.elastic.co/t/drilldown-based-on-query-results/301122>\
**Category:** Kibana\
**Created:** [March 30, 2022, 4:16pm UTC](https://discuss.elastic.co/t/drilldown-based-on-query-results/301122 "2022-03-30T16:16:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DamiaRita](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/damiarita/32/103728_2.png) [@DamiaRita](https://discuss.elastic.co/u/DamiaRita)\
**Post date:** [March 30, 2022, 4:16pm UTC](https://discuss.elastic.co/t/drilldown-based-on-query-results/301122/1 "2022-03-30T16:16:26Z")

</div>

Hi,

I want to connect two dashboards via Drilldown (or a similar feature). I have been reading the docs regarding drilldown and did not find a way to do precisely what I want. So, I am hoping for someone with more experience 🫵 to have an idea 💡 I could not have (do you think I should merge my indices?!).

The two dashboards I want to connect do not use the same index. They use different but related indices (I will use an example that is equivalent to my use case so that you do not need to understand the details of my organization). One dashboard presents data from an `orders` index. Another dashboard, from a `payments` index. Each order can have more than one payment.

`orders` documents have properties like `id` (id of the order), `product_name`, `client_id`, `purchase_date`, `delivery_date`, `cost`, `payment_ids` (it's an array), `payment_amounts` (it's an array).  
`payment` documents have properties like `id` (id of the payment), `order_id`, `date`, `payment_method`, `amount`.

Here is what I would like to do. You are in the `orders` dashboard 📊, you have filtered the data down to some specific orders that you need to investigate (for example, orders for a specific product 📦 in a specific period 🗓) and you want to see the payments dashboard 📈 for the payments of those orders. Since the filters are on product\_name and on purchase\_date, you cannot carry those filters over to the payments dashboard 📈. What I want to carry over is the list of payment\_ids.

The opposite case is also possible: you are in the payments dashboard 📈, you have filtered it down to payments done with credit card 💳 after a certain date 📅 (for example), and you want to see the orders dashboard of the related orders. I don't want to carry over the filters: orders don't know about credit card or payment date. All I want to see is the orders dashboard for a list of `order_id`s.

How can I do this? I don't want to copy filters. I want go to a dashboard with a specific list of document ids. I guess I could generate an URL if I know the ids, but how can I get data from the documents while generating a drilldown URL?

Thanks for reading my rather long post! 🤐

---

<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:** [April 27, 2022, 4:16pm UTC](https://discuss.elastic.co/t/drilldown-based-on-query-results/301122/2 "2022-04-27T16:16:52Z")

</div>

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