# How to pass Values from Drop-down Filter in to ESSQL Query in Kibana Canvas Workpad

**URL:** <https://discuss.elastic.co/t/how-to-pass-values-from-drop-down-filter-in-to-essql-query-in-kibana-canvas-workpad/190041>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [July 11, 2019, 2:28pm UTC](https://discuss.elastic.co/t/how-to-pass-values-from-drop-down-filter-in-to-essql-query-in-kibana-canvas-workpad/190041 "2019-07-11T14:28:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sankalan\_Banerjee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sankalan_banerjee/32/45660_2.png) [@Sankalan\_Banerjee](https://discuss.elastic.co/u/Sankalan_Banerjee)\
**Post date:** [July 11, 2019, 2:29pm UTC](https://discuss.elastic.co/t/how-to-pass-values-from-drop-down-filter-in-to-essql-query-in-kibana-canvas-workpad/190041/1 "2019-07-11T14:29:00Z")

</div>

Hi,

We have created a Drop-down Filter in Kibana Canvas Workpad which shows the List of Defect Fix Versions :-

```
 `essql query="SELECT defect_fix_version FROM \"project_defect_list*\""`

```

`| dropdownControl valueColumn="defect_fix_version" filterColumn="defect_fix_version"`  
`| render`

Now we created a Markdown Content which shows the Test Effectiveness %.

`essql`  
"`SELECT defect_component, COUNT(defect_jira_id) AS count FROM \"project_defect_list\" GROUP BY defect_component"`  
`| mapColumn "defect_component"`  
`fn={if {getCell "defect_component" | eq "Exists in Prod"} then={getCell "defect_component"} else="Other"}`  
`| ply by="defect_component" fn={math "sum(count)" | as "count"}`  
`| staticColumn "total" value={math "sum(count)"}`  
`| mapColumn "percentage" fn={math "floor(count/total * 100, 0)"}`  
`| filterrows {getCell "defect_component" | any {eq "Other"}}`  
`| markdown {getCell "percentage"} "%"`  
`font={font family="'Open Sans', Helvetica, Arial, sans-serif" size=30 align="center" color="#FFFFFF" weight="bold" underline=false italic=false}`

We want to filter the Test Effectiveness % based on the Fix Version selected from the drop down filter. It will be very helpful if you can let us know how to do that?

Currently the Test Effectiveness % is showing across all Fix Versions.

Regards,  
Sankalan Banerjee

---

<div class="post-metadata">

**Author:** ![tims](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tims/32/46750_2.png) [@tims](https://discuss.elastic.co/u/tims)\
**Post date:** [July 12, 2019, 9:20pm UTC](https://discuss.elastic.co/t/how-to-pass-values-from-drop-down-filter-in-to-essql-query-in-kibana-canvas-workpad/190041/2 "2019-07-12T21:20:28Z")

</div>

Hi @Sankalan_Banerjee,

What happens when you select a specific defect\_fix\_version in the dropdown? Does the Test Effectiveness % continue to show across all versions? Or does it go to 0? Can you also provide a few examples of what a defect\_fix\_version looks like?

---

<div class="post-metadata">

**Author:** ![Sankalan\_Banerjee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sankalan_banerjee/32/45660_2.png) [@Sankalan\_Banerjee](https://discuss.elastic.co/u/Sankalan_Banerjee)\
**Post date:** [July 26, 2019, 8:04pm UTC](https://discuss.elastic.co/t/how-to-pass-values-from-drop-down-filter-in-to-essql-query-in-kibana-canvas-workpad/190041/3 "2019-07-26T20:04:05Z")

</div>

> [@tims](#):
>
> at a defect\_fix\_version looks like?

When I select any specific value i.e. defect\_fix\_version from the drop down filter, it shows an Alert Sign with Error as : "Whoops! Expression failed  
Expression failed with the message:  
[mapColumn] \> Cannot read property 'defect\_component' of undefined"

Expression used:

```
filters

```

`| essql`  
` "SELECT defect_component, COUNT(defect_jira_id) AS count FROM \"project_defect_list\" GROUP BY defect_component"`  
`| mapColumn "defect_component"`  
` fn={if {getCell "defect_component" | eq "Exists in Prod"} then={getCell "defect_component"} else="Other"}`  
`| ply by="defect_component" fn={math "sum(count)" | as "count"}`  
` | staticColumn "total" value={math "sum(count)"}`  
`| mapColumn "percentage" fn={math "floor(count/total * 100, 0)"}`  
`| filterrows {getCell "defect_component" | any {eq "Other"}}`  
`| markdown {getCell "percentage"} "%"`  
` font={font family="'Open Sans', Helvetica, Arial, sans-serif" size=30 align="center" color="#FFFFFF" weight="bold" underline=false italic=false}`

Let me know if you need any more details.

Regards,  
Sankalan Banerjee

---

<div class="post-metadata">

**Author:** ![tims](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tims/32/46750_2.png) [@tims](https://discuss.elastic.co/u/tims)\
**Post date:** [August 5, 2019, 7:19pm UTC](https://discuss.elastic.co/t/how-to-pass-values-from-drop-down-filter-in-to-essql-query-in-kibana-canvas-workpad/190041/4 "2019-08-05T19:19:09Z")

</div>

@Sankalan_Banerjee It looks like you are re-mapping the values of defect\_component to be either "Exists in Prod" or "Other" so I would imagine when the filter tries to apply a value that isn't one of those 2 things it would break. Is that what is happening?

---

<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:** [September 2, 2019, 7:19pm UTC](https://discuss.elastic.co/t/how-to-pass-values-from-drop-down-filter-in-to-essql-query-in-kibana-canvas-workpad/190041/5 "2019-09-02T19:19:10Z")

</div>

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