Help

Re: Grouped field with a sum of previous rows

1227 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Petr_Ogurcak1
4 - Data Explorer
4 - Data Explorer

Hi, I have in shortcut

  • table Products
  • table Deliveries with a link to a product and amount of the product we bought in that particular delivery
    and some other tables storing how many products were sold, used, etc.

and I would need to have a Stock table with rows grouped by product with information how many of product from that delivery is still in a warehouse. Simply first in first out.

To do that I would need to know how many pieces I have already bought in the time of a particular Delivery.

For example we have 3 deliveries of 5, 10 and 15 pieces and we sold 17 pieces so I would like to have 3 rows of Product, delivered amount, amount left.

In this it would be
XX - 5 - 0
XX - 10 - 0
XX - 15 - 13

There is 0 pieces from the first delivery, 0 pieces form the second delivery and 13 pieces from the last delivery.

Does it make sense? Any idea how to do that? The problem is how to calculate that after fisrt delivery we have bought altogether 5 pieces, after second delivery 15 pieces and after third delivery 30 pieces altogether.

10 Replies 10

Having delivery and subdeliveries doesn’t help or I don’t see a way. I’m able to do SUM of associated deliveries but I’m not able to do SUM of previous associated deliveries. Have a look here https://airtable.com/shrGv4VthYG6JcIgI I faked in the table stock column amount_in_stock to have exactly what I need.