Let’s say I have a table that lists purchases and sales of different items in my store (Inventory table), and each row represents either a purchase from a vendor (increase to inventory) or a sale to a customer (decrease in inventory). There are multiple products that are being added for sale and many that are sold for brief periods of time so the list of Products is constantly changing and most are “out of stock.”
Let’s say I want to create a view on this table grouped on the Product column to see my current inventory and I need to exclude any Products where I have no inventory (ie., sum of product-count for that Product = 0),
How would I do that? I know I can create a new column on the table (ie, named Current Inventory) and do something like this:
Inventory.filter(thisrow.Product).Quantity.Sum()
Is there a way of doing it without adding a new Column?
And because no data set is ever perfect (much as a programmer or doc maker might hope otherwise), you might consider adding a manual override checkbox of some kind called “Retired” that means “even though the system might be showing some stock, I happen to know that’s not true and we’re not selling this anymore”. And then filter based on that too.
Nice. A related tip is to always have the “true” version of any table tucked away in a hidden folder. That version can have all its guts spilled out for when you’re tinkering with things, and then all other instances in your doc are just views.