# Filter Data and Count

**URL:** <https://community.glideapps.com/t/filter-data-and-count/60900>\
**Category:** Ask for Help\
**Created:** [April 24, 2023, 4:17am UTC](https://community.glideapps.com/t/filter-data-and-count/60900 "2023-04-24T04:17:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![atiwat\_tangchaiwatta](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/atiwat_tangchaiwatta/32/22191_2.png) [@atiwat\_tangchaiwatta](https://community.glideapps.com/u/atiwat_tangchaiwatta)\
**Post date:** [April 24, 2023, 4:17am UTC](https://community.glideapps.com/t/filter-data-and-count/60900/1 "2023-04-24T04:17:04Z")

</div>

Hello , Community , Now I am working on inventory and Sale tracking features  
I wonder if

1. Can we filter Date in glide ( Only this week) , I want to filter only activities that happen in this week
2. Is there any ways to set count condition , I am working on Sale tracking project ( Every time sale visit customer , they need to check in by submitting form in our apps with fundamental information) , And I want to count how many total customers they visit weekly ( In Excel I use count if with date condition but I wonder is there more simple way to do in Glide ?)

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [April 24, 2023, 4:23am UTC](https://community.glideapps.com/t/filter-data-and-count/60900/2 "2023-04-24T04:23:04Z")

</div>

Yes… click my avatar and link to my website (it is a Glide Page)… then you click again… you will see that it will track you 😉

---

<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:** [April 24, 2023, 11:50pm UTC](https://community.glideapps.com/t/filter-data-and-count/60900/3 "2023-04-24T23:50:10Z")

</div>

> [@atiwat\_tangchaiwatta](#):
>
> Can we filter Date in glide ( Only this week) , I want to filter only activities that happen in this week

If you mean the native filtering, then you can use 2 math columns to help with that.

In the table where you record activities, I assume you have recorded the time that the activitiy happened, then the formula for the math column would be:

> YEAR(T)\*100 + WEEKNUM(T) - YEAR(N)\*100 - WEEKNUM(N)

With T being the timestamp of the activity, and N being the “now” value.

If it’s the current week, you would get 0 as the result.

---

<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:** [April 24, 2023, 11:51pm UTC](https://community.glideapps.com/t/filter-data-and-count/60900/4 "2023-04-24T23:51:12Z")

</div>

> [@atiwat\_tangchaiwatta](#):
>
> Is there any ways to set count condition , I am working on Sale tracking project ( Every time sale visit customer , they need to check in by submitting form in our apps with fundamental information) , And I want to count how many total customers they visit weekly ( In Excel I use count if with date condition but I wonder is there more simple way to do in Glide ?)

So how do you want to present that info in the front end? Do you present it as a list of weeks and their corresponding count?

---

<div class="post-metadata">

**Author:** ![atiwat\_tangchaiwatta](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/atiwat_tangchaiwatta/32/22191_2.png) [@atiwat\_tangchaiwatta](https://community.glideapps.com/u/atiwat_tangchaiwatta)\
**Post date:** [April 25, 2023, 7:47am UTC](https://community.glideapps.com/t/filter-data-and-count/60900/5 "2023-04-25T07:47:42Z")

</div>

This is EPIC , really thanks for your answer , I got noob questions

1. How to create Now Date in Glide , I create Date column there is no Now option
2. On Google Sheet , I apply =NOW() which it working but when I apply ArrayFormular =ArrayFormula(NOW()) It doesn’t auto fill those below and new added row

---

<div class="post-metadata">

**Author:** ![atiwat\_tangchaiwatta](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/atiwat_tangchaiwatta/32/22191_2.png) [@atiwat\_tangchaiwatta](https://community.glideapps.com/u/atiwat_tangchaiwatta)\
**Post date:** [April 25, 2023, 7:49am UTC](https://community.glideapps.com/t/filter-data-and-count/60900/6 "2023-04-25T07:49:50Z")

</div>

1. I want to count total of rows that happen both weekly and monthly Ex A sale has submit 10 in this week , 45 / month like that
2. It would be nice if there’s Number + Customer  
Ex : 1. Customer A  
2. Customer Jack  
3. Customer John

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 25, 2023, 9:42am UTC](https://community.glideapps.com/t/filter-data-and-count/60900/7 "2023-04-25T09:42:39Z")

</div>

> [@atiwat\_tangchaiwatta](#):
>
> How to create Now Date in Glide , I create Date column there is no Now option

Use a Math column, with Now as a replacement.

 ![CleanShot 2023-04-25 at 17.41.36@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/8/78c83f6b6df1aa97f043917040520350fda7c001.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:** [April 25, 2023, 11:57pm UTC](https://community.glideapps.com/t/filter-data-and-count/60900/8 "2023-04-25T23:57:00Z")

</div>

> [@atiwat\_tangchaiwatta](#):
>
> I want to count total of rows that happen both weekly and monthly Ex A sale has submit 10 in this week , 45 / month like that

So you only need the numbers to show stats of “this week”, “this month”?

---

<div class="post-metadata">

**Author:** ![atiwat\_tangchaiwatta](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/atiwat_tangchaiwatta/32/22191_2.png) [@atiwat\_tangchaiwatta](https://community.glideapps.com/u/atiwat_tangchaiwatta)\
**Post date:** [April 26, 2023, 7:05am UTC](https://community.glideapps.com/t/filter-data-and-count/60900/9 "2023-04-26T07:05:56Z")

</div>

Exactly

---

<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:** [April 26, 2023, 11:19pm UTC](https://community.glideapps.com/t/filter-data-and-count/60900/10 "2023-04-26T23:19:02Z")

</div>

I suppose this is what you can do:

- In your users table, create a math column to calculate the current week’s numerical value:

YEAR(N)\*100 + WEEK(N)

With N being the “Now” value.

- In your users table, create a math column to calculate the current month’s numerical value:

YEAR(N)\*100 + MONTH(N)

With N being the “Now” value.

- In your users table, create a template column joining the user’s rowID/email with the current week’s value above.

- In your users table, create a template column joining the user’s rowID/email with the current month’s value above.

- In the sales record table, do the same process to create 4 columns, but instead of using “Now” in the math columns, use the timestamp the record was added.

- Create 2 relations from the 2 templates in the Users table to its corresponding templates in the Sales record table, make them match multiple rows.

- Create 2 rollup columns on top of 2 relations to count the number of matching rows.
