Inventory management

inventory app
I have applied the following code to stock
When the sales records are deleted, the stock balance returns again as if the sale had not taken place, knowing that the sale has already taken place.
Item Balance Empty
I want when selling an item that is actually reduced from stock

SUM(
SELECT(
Purchases[Quantity],
[Product Barcode] = [_THISROW].[Product Barcode]
)) -
SUM(
SELECT(
Sales[Quantity],
[Product Barcode] = [_THISROW].[Product Barcode]
)) +
[Initial Stock]

 

 

0 1 76
1 REPLY 1

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Ahmad_1,

You may want to try that instead in a Virtual column:

[Initial Stock]
+SUM([Related Purchasess][Quantity])
-SUM([Related Saless][Quantity])

This suggestion is equivalent to yours, in a more easier and efficient way.

- Using a virtual column will produce the expression always correct, as it is calculated on the fly.

- Using physical/Real column will produce an expression that is correct on edition moment only. It will remain until you edit the row again.

 For reference:

Use virtual columns - AppSheet Help

List expressions - AppSheet Help

 

 

Top Labels in this Space