Vizulization from exact match

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.

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.

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

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 -

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.

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

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

oh man it did the trick. it is working

1 Like

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