# Vizulization from exact match

**URL:** <https://discuss.elastic.co/t/vizulization-from-exact-match/202352>\
**Category:** Kibana\
**Created:** [October 4, 2019, 1:46pm UTC](https://discuss.elastic.co/t/vizulization-from-exact-match/202352 "2019-10-04T13:46:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [October 4, 2019, 1:46pm UTC](https://discuss.elastic.co/t/vizulization-from-exact-match/202352/1 "2019-10-04T13:46:17Z")

</div>

This is what I have in record

user direct\_manager managers  
foo bar bar tame tutu  
barf tame tame tutu  
jams tame tame tutu

I want two visualize where it shows all the hierarchy of manager and direct report for a manager

ie. if I select tame one report only should show

barf and james

second report should show foo, bar and james  
how do I achieve it?

for now if I use word tame on filter bar it give me full hierarchy.  
but then it want eliminate foo (because tame is not it's direct mangager)

I am so falling over this logic. LOL  
I can easilly create new field or update any value on this data that is not a problem. but having hard time to figure this out.

All this is for setting up visualization.

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [October 4, 2019, 5:27pm UTC](https://discuss.elastic.co/t/vizulization-from-exact-match/202352/2 "2019-10-04T17:27:04Z")

</div>

Which version of the elastic stack are you using?

Could you share a screenshot of your current progress?

It seems to me that you should be able to filter by `direct_manager` but I might be missing something about your problem.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [October 4, 2019, 5:39pm UTC](https://discuss.elastic.co/t/vizulization-from-exact-match/202352/3 "2019-10-04T17:39:11Z")

</div>

I am using 7.3.1

I think I am not able to explain here properly.

Goal is that when I select/type a manager name I need two visualize to be populated.

1. only user who are directly reporting to that manager
2. all the user who are in hierarchy of that manager

Following works for case-1, but how do I get everything under that manger even if user is not directly reporting to him/her.

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

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [October 7, 2019, 7:00pm UTC](https://discuss.elastic.co/t/vizulization-from-exact-match/202352/4 "2019-10-07T19:00:10Z")

</div>

I'd like to restate the problem to make sure we're both thinking about the same problem -

Given a manager, I want to see a list of direct reports and a list of indirect reports.

Assuming that statement is correct -

I think its helpful to start by structuring the data so that its easy to answer the question. Its not always possible but can save a lot of trouble when it is.

I'd modify the data structure as such -

```auto
user direct_manager indirect_managers
foo bar [tame, tutu]
barf tame [tutu]
jams tame [tutu]

```

Now if we query `direct_manager` for `tame` we will get `barf` and `james`. If we query `indirect_managers` for `tame` we will only get foo. Notice that `indirect_managers` is an array.

However, we need to be able to query both fields and show different data in different visualizations. I think it should work to query both the manager fields using a OR clause and then each visualization can have its own filter.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [October 7, 2019, 8:53pm UTC](https://discuss.elastic.co/t/vizulization-from-exact-match/202352/5 "2019-10-07T20:53:45Z")

</div>

That make sense @mattkime

let me restructure the data. I just have to find out how do I put that input  
managers =\> tame tutu in to array

and test it

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [October 7, 2019, 9:16pm UTC](https://discuss.elastic.co/t/vizulization-from-exact-match/202352/6 "2019-10-07T21:16:37Z")

</div>

This might help - [https://www.elastic.co/guide/en/elasticsearch/reference/current/array.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/array.html)

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [October 7, 2019, 9:19pm UTC](https://discuss.elastic.co/t/vizulization-from-exact-match/202352/7 "2019-10-07T21:19:40Z")

</div>

oh man it did the trick. it is working

---

<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:** [November 4, 2019, 9:19pm UTC](https://discuss.elastic.co/t/vizulization-from-exact-match/202352/8 "2019-11-04T21:19:44Z")

</div>

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