# selectattr filter questions

**URL:** <https://community.hubspot.com/t/selectattr-filter-questions/13969>\
**Category:** CMS Development\
**Tags:** hubdb\
**Created:** [April 11, 2019, 8:36pm UTC](https://community.hubspot.com/t/selectattr-filter-questions/13969 "2019-04-11T20:36:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jestlinbaum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jestlinbaum/32/68653_2.png) [@jestlinbaum](https://community.hubspot.com/u/jestlinbaum)\
**Post date:** [April 11, 2019, 8:36pm UTC](https://community.hubspot.com/t/selectattr-filter-questions/13969/1 "2019-04-11T20:36:41Z")

</div>

I have the following code to filter rows in a DB table:

`{% set table = hubdb_table_rows(1040830, queryparam) %}`

After those rows are returned I have the following code to further list the results:

```auto
{% set easi_set_buildings = table|selectattr('catid','equalto','eset-std') %}

{% if easi_set_buildings == [] %}
 <!-- Do Nothing -->
{% else %}
 <h3>Headline</h3>
 {% for row in easi_set_buildings %}
 Do Stuff
 {% endfor %}
{% endif %}

```

This is working fine.

Here are my questions.

1. I tried using the following:

{% set easi\_set\_buildings = table|selectattr(‘catid’,‘ **containing** ’,‘eset-std’) %}

and nothing happened.

Can I use the selectattr filter when referencing a multi select column (or a column that contains multiple values)?

2. Can I apply multiple “requests” to the selectattr filter… like:

`{% set easi_set_buildings = table|selectattr('catid','equalto','eset-std' AND 'subcatid','containing','blah') %}`

Any help is greatly appreciated.

Thanks!

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [April 12, 2019, 9:32pm UTC](https://community.hubspot.com/t/selectattr-filter-questions/13969/2 "2019-04-12T21:32:27Z")

</div>

Hi @jestlinbaum ,

have you tried to concatenate the both options?

I’ve had a project last year where I had to concatenate multiple HubDB column entries to one filter… the concatenate operator did it’s job 🙂

You can find the thread [here](https://community.hubspot.com/t5/CMS-Development/HubDB-filtering-by-custom-module)

---

<div class="post-metadata">

**Author:** ![jestlinbaum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jestlinbaum/32/68653_2.png) [@jestlinbaum](https://community.hubspot.com/u/jestlinbaum)\
**Post date:** [April 16, 2019, 3:35pm UTC](https://community.hubspot.com/t/selectattr-filter-questions/13969/3 "2019-04-16T15:35:40Z")

</div>

@Anton thanks for the response!

The link you left gives me this:

“The page you are trying to access was not found. Please check your URL for typos and try again.”

Would love to see it.

Are you referring to the Join filter?

Thanks again.

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [April 16, 2019, 6:15pm UTC](https://community.hubspot.com/t/selectattr-filter-questions/13969/4 "2019-04-16T18:15:13Z")

</div>

@jestlinbaum my bad.

Had copied only a part from the link 🙂

Here’s the [complete one](https://community.hubspot.com/t5/CMS-Development/HubDB-filtering-by-custom-module/m-p/203040)

If this shouldn’t work - search for “HubDB filtering by custom module” by “Anton”(me) in this board. 🙂

Please let me know, if this works for you

regards

Anton

---

<div class="post-metadata">

**Author:** ![jestlinbaum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jestlinbaum/32/68653_2.png) [@jestlinbaum](https://community.hubspot.com/u/jestlinbaum)\
**Post date:** [April 17, 2019, 9:56am UTC](https://community.hubspot.com/t/selectattr-filter-questions/13969/5 "2019-04-17T09:56:07Z")

</div>

@Anton yes, I think this is what I’m looking for.

Thank you so much!

---

<div class="post-metadata">

**Author:** ![ben-duchy](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ben-duchy/32/84083_2.png) [@ben-duchy](https://community.hubspot.com/u/ben-duchy)\
**Post date:** [April 1, 2021, 4:36pm UTC](https://community.hubspot.com/t/selectattr-filter-questions/13969/6 "2021-04-01T16:36:37Z")

</div>

I’m trying something similar but with dates. Any idea what I’m doing wrong?  
{% set num\_meetings = table | selectattr (“meeting”,“equalto”,“28/05/2021”) | datetimeformat(‘%e/%m/%Y’) | length %}

{{ num\_meetings }} \<!-- number of meetings for this date should be displayed but I can’t get it to work --\>
