Help

Rollup - Sum Last 7 Days Sales

1001 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Matt_Lawry
4 - Data Explorer
4 - Data Explorer

Hey Guys,

Pretty new to AirTable and struggling to work out how to achieve this.

I have 2 tables - product data-base and orders.

I created a Rollup field for the SUM of sales for each product variant (Variant ID). This worked great, but I don’t want to see total sales only the last 7 days sales. I.e. TODAY - 7. I’d like this to update dynamically each day

Is there a formula which will sum the last 7 day sales by variant from ‘Orders’ and feed this into ‘Product Database’?

Thanks!

1 Reply 1

Hi @Matt_Lawry - if you’ve got an orders table similar to this:

Screenshot 2019-05-07 at 09.31.43.png

Add another column that shows the quantity sold if the order was in the last 7 days - the formula in my base is this:

IF(DATETIME_DIFF(NOW(), Date, 'days') > 7, 0, Quantity)

Now, back in your product table you can roll-up this field:

Screenshot 2019-05-07 at 09.33.37.png

Hope this helps.

JB