# Manipulate filter values programmatically

**URL:** <https://discuss.elastic.co/t/manipulate-filter-values-programmatically/156996>\
**Category:** Kibana\
**Created:** [November 16, 2018, 7:42am UTC](https://discuss.elastic.co/t/manipulate-filter-values-programmatically/156996 "2018-11-16T07:42:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilanas](https://avatars.discourse-cdn.com/v4/letter/i/c57346/32.png) [@ilanas](https://discuss.elastic.co/u/ilanas)\
**Post date:** [November 16, 2018, 7:42am UTC](https://discuss.elastic.co/t/manipulate-filter-values-programmatically/156996/1 "2018-11-16T07:42:27Z")

</div>

Good morning,  
I want to know if there is the option of taking the value of a filter and based on it graphing. the problem comes to me that in a series I have the concept 'All'. If filter by 'All' is displayed well, if you filter by a department, it shows well but leaving the filter blank, I add the departments with the concept 'All' and distort the data. This with a filter that does not allow multi-selection is valid but I need it to be multiselection. The idea is that if nothing is selected in the filter I want to eliminate the concept 'All' of the series. please help.

---

<div class="post-metadata">

**Author:** ![ilanas](https://avatars.discourse-cdn.com/v4/letter/i/c57346/32.png) [@ilanas](https://discuss.elastic.co/u/ilanas)\
**Post date:** [November 19, 2018, 7:52am UTC](https://discuss.elastic.co/t/manipulate-filter-values-programmatically/156996/2 "2018-11-19T07:52:21Z")

</div>

Anyone some help, please?

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [November 21, 2018, 2:01am UTC](https://discuss.elastic.co/t/manipulate-filter-values-programmatically/156996/3 "2018-11-21T02:01:35Z")

</div>

Can you share some screenshots to help me understand what's going on?

---

<div class="post-metadata">

**Author:** ![ilanas](https://avatars.discourse-cdn.com/v4/letter/i/c57346/32.png) [@ilanas](https://discuss.elastic.co/u/ilanas)\
**Post date:** [November 21, 2018, 7:50am UTC](https://discuss.elastic.co/t/manipulate-filter-values-programmatically/156996/4 "2018-11-21T07:50:03Z")

</div>

sorry but screenshots with the data i can't share. i try to explain well. for example, i have this department :  
-desarrollo  
-programación  
-testing  
and in the sql y do an union with the concept 'ALL'.

so finally i have 4 department ( desarrollo,programacion,testing, all).  
the departments, have a concept of money and a concept of proyect (School,University,job..).  
now i wnat to do 2 visualization.

![departamento](https://us1.discourse-cdn.com/elastic/original/3X/5/7/57b1573de4af66dfafcbb65dd66bce4081637b35.png)

![tipo](https://us1.discourse-cdn.com/elastic/original/3X/0/8/08a8be947b96da405f667680eff94dafc41068c7.png)

The problem is the next... in the first plot all is ok. if i filter bi 'ALL' onli look the sum of all departments, if the filter is blank i show the 4 lines well and if i filter by some or multiple department i show everithing well.  
In the second chart where thye series aren't the departments, come the error. If i filter by 'ALL' i show well, if i filter by one or more department i show well but when the filter is blank the data is wrong because the proyects catch the sum of the 3 departments and the sum of concept 'ALL' so i have the double of the real data... Is there any solution for this error??? thank you

---

<div class="post-metadata">

**Author:** ![ilanas](https://avatars.discourse-cdn.com/v4/letter/i/c57346/32.png) [@ilanas](https://discuss.elastic.co/u/ilanas)\
**Post date:** [November 21, 2018, 7:51am UTC](https://discuss.elastic.co/t/manipulate-filter-values-programmatically/156996/5 "2018-11-21T07:51:23Z")

</div>

if you don't understand my explanation please say to me.

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [November 21, 2018, 2:15pm UTC](https://discuss.elastic.co/t/manipulate-filter-values-programmatically/156996/6 "2018-11-21T14:15:06Z")

</div>

Sorry, I'm struggling to interpret what you're trying to do, but I suspect the issue is that the filters are applying too broadly.

Have you tried to split the lines with a filters aggregation like so?

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

---

<div class="post-metadata">

**Author:** ![ilanas](https://avatars.discourse-cdn.com/v4/letter/i/c57346/32.png) [@ilanas](https://discuss.elastic.co/u/ilanas)\
**Post date:** [November 21, 2018, 2:29pm UTC](https://discuss.elastic.co/t/manipulate-filter-values-programmatically/156996/7 "2018-11-21T14:29:02Z")

</div>

I do not understand you very well But I think that is not what I want. My problem is in the second table where the series are projects and not departments. In this graphic I want to take the money out of each project. that is, the sum of school, university and job money for each project. Since I have an invented department that is the sum of the other 3 departments(ALL), when I graph the graph, it shows me the duplicated data since for each project I add college, university, work and all. I hope you have explained to me now

---

<div class="post-metadata">

**Author:** ![ilanas](https://avatars.discourse-cdn.com/v4/letter/i/c57346/32.png) [@ilanas](https://discuss.elastic.co/u/ilanas)\
**Post date:** [November 21, 2018, 2:29pm UTC](https://discuss.elastic.co/t/manipulate-filter-values-programmatically/156996/8 "2018-11-21T14:29:29Z")

</div>

say me if you understand me please

---

<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:** [December 19, 2018, 2:29pm UTC](https://discuss.elastic.co/t/manipulate-filter-values-programmatically/156996/9 "2018-12-19T14:29:49Z")

</div>

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