# How to filter using an array?

**URL:** <https://talk.observablehq.com/t/how-to-filter-using-an-array/7340>\
**Category:** Help\
**Created:** [November 27, 2022, 2:21pm UTC](https://talk.observablehq.com/t/how-to-filter-using-an-array/7340 "2022-11-27T14:21:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adham-omran](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/adham-omran/32/7226_2.png) [@adham-omran](https://talk.observablehq.com/u/adham-omran)\
**Post date:** [November 27, 2022, 2:21pm UTC](https://talk.observablehq.com/t/how-to-filter-using-an-array/7340/1 "2022-11-27T14:21:28Z")

</div>

Hey all!

I’m trying to filter data by a column, I have an array of selected values that I want find in the data.

The column is named `symbol` and using `Inputs.select(list, {mutiple: true})` I can get an array of symbols, let’s say for example that `list` contained `["AAAA", "BBBB", "CCCC"]` and the user selected `AAAA` and `BBBB`.

How to return data rows that match that array for the colmun `symbol`?

I have tried to look in Arquero’s documentation but nothing came up for partial selection, maybe I missed something. Closest thing I got was

`df.filter(d => d.includes(d["symbol"], ["AAAA"]))` but this doesn’t work for  
`df.filter(d => d.includes(d["symbol"], ["BBBB", "AAAA"]))`

Thank you

---

<div class="post-metadata">

**Author:** ![Ananya](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@Ananya](https://talk.observablehq.com/u/Ananya)\
**Post date:** [November 27, 2022, 10:09pm UTC](https://talk.observablehq.com/t/how-to-filter-using-an-array/7340/2 "2022-11-27T22:09:10Z")

</div>

Hi,

You’re close! You want to check if the selected values from the list include d.symbol. Something like this: df.filter(d =\> selection.includes(d.symbol))

> **[How to filter using an array](https://observablehq.com/d/a60e73722a41a8e3)**
>
> forum question

Hope this helps!

---

<div class="post-metadata">

**Author:** ![adham-omran](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/adham-omran/32/7226_2.png) [@adham-omran](https://talk.observablehq.com/u/adham-omran)\
**Post date:** [November 28, 2022, 11:35am UTC](https://talk.observablehq.com/t/how-to-filter-using-an-array/7340/3 "2022-11-28T11:35:47Z")

</div>

It did, thank you!
