# Custom Filter on Query Column

**URL:** https://community.glideapps.com/t/custom-filter-on-query-column/77660
**Category:** Ask for Help
**Created:** [November 6, 2024, 1:03pm UTC](https://community.glideapps.com/t/custom-filter-on-query-column/77660 "2024-11-06T13:03:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Christine\_Davis](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/christine_davis/32/81683_2.png) [@Christine\_Davis](https://community.glideapps.com/u/Christine_Davis)
#### Post date: [November 6, 2024, 1:03pm UTC](https://community.glideapps.com/t/custom-filter-on-query-column/77660/1 "2024-11-06T13:03:04Z")

</div>

I want to present the average over the last 7 days for a single column. I am trying to use the query column to create the 7 day filter but it doesn’t appear to give me an option to enter as recommended by the chat NOW() - DURATION(“7 days”). I select date, on or after, and then it defaults to “now” with the only alternative option being to select today, date, or this row. What am I missing?

---

<div class="post-metadata">

### Author: ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)
#### Post date: [November 6, 2024, 1:10pm UTC](https://community.glideapps.com/t/custom-filter-on-query-column/77660/2 "2024-11-06T13:10:23Z")

</div>

You might want to create a math column that will calculae now - 7 days:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/0/702e0d9cc728948a0f4a0aa5cba67003a9b78616.png)

Then, in the query filter, is two date conditions like this:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/d/0db8af0f152073b83425cf3584a9d55923d44453.png)

So the data will be filtered correctly.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/9/89553f5df2f28a8cd98d18d1199ef94b7144e7f8.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/6/d68ce3b254ba3a7759a054634e4274625d1d10fd.png)

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [November 6, 2024, 11:26pm UTC](https://community.glideapps.com/t/custom-filter-on-query-column/77660/3 "2024-11-06T23:26:38Z")

</div>

Then, after you have the query as Maxime suggested, add a rollup column, reference the query, and get the average of the column you need.
