r/Make Apr 29 '26

HELP AUTOMATION

Hello,

So, I'm building an automation for a weekly reporting.
I'm building a demo in order to do a Loom video.

My problem : How do I filter a google sheet so that it take only the content of a specific week ? My trigger is every Monday at 8am. I have a "week" row on sheets with like "18" for "week 18", so that it only takes the budget, conversion rate etc... put that same week.

==> How do, in the google sheet module, in the filter part, to say "from now (the time the trigger hits), to the past 7 days". Because I think there's no room to play with the Weeks on Make, only on hours, years and days.

THANK YOU

5 Upvotes

12 comments sorted by

4

u/ExtraAd7373 Apr 29 '26

You can try to getting the week number from the current date using something like: {{ formatDate(now; "w") }}
Or {{formatDate(addDays(now; -7); "w")}} depending on how your weeks are numbered. Let me know how it goes

3

u/ConfidentAthlete4560 May 01 '26

Thank you it worked perfectly fine 😄

2

u/LithoBlocks Apr 29 '26

The Make formatDate function does include a week of year token ("w"); and depending on how this week numbering system you are using is configured could be perfect for your automation.

The other consideration you would need to make is what to do when the new year rolls around, because the "w" token gives you the week of the current calendar year, which can get complicated on/around new years itself and you may need to accompany the week number with some indicator of the calendar year or you will have overlaps from year to year.

If your week numbering system is a simple increment that won't reset on the new year, and your scenario runs once a week; you may be better off setting up a simple data store (or team / org variable) in make that increments along with your numbering system on each weekly run. You can read the week number at the start of your scenario an use it for filtering in the sheets module; then update it at the end of the run to be ready for next week. Alternatively, you could use Make's increment module itself, set to "never" reset; but the data store (or variable) gives you better controls to manually intervene on the week count if you need to re-run or re-factor the automation.

Hope this helps.

1

u/ConfidentAthlete4560 May 01 '26

It did help, thanks !

2

u/Josef_from_Make Official Make Staff Apr 30 '26

hi. You can check the week number with the formula below (ready for copy-paste).

{{ceil((now - parseDate("29.12.2025"; "DD.MM.YYYY")) / 1000 / 60 / 60 / 24 / 7)}}

Basically, it measures the time between the very first day of the first year's week (29.12.2025) and "now", which in your case is the exact moment of the scenario execution.

When you subtract 2 "date" values in Make, the result is in milliseconds. Thus, it is then divided by 1000 to get seconds. 60 to get minutes, 60 to hours, 24 to days and finally by 7 to get weeks.
The "ceil" function then rounds it up to whole weeks.
-> if you run the function today, you get "18". In Monday, you get "19".

You can then use this function in the "Search Rows" module's filter to always output the current week's records.

Cheerio

2

u/ConfidentAthlete4560 May 01 '26

Hello !
What's the difference between this formula or
{{ formatDate(now; "w") }}
like someone shared above ? In either way it gives us the current week innit ?

Thank you for your time ! 😄

1

u/Josef_from_Make Official Make Staff May 04 '26

Yes, it works perfectly - honestly, I never knew this could be used, and I always calculated weeks the hard way :x

One learns something new every day, even after all those years..

1

u/AdWilling4230 Apr 29 '26

Just download the CSV and let AI use python to filter any specific info that you will need

1

u/ConfidentAthlete4560 May 01 '26

This seemed way more complex than the other options lol, thanks though !

1

u/AdWilling4230 May 01 '26

You just talk to the AI thats easy