Set analysis or another method to get accurate data
Hi
After a lot of help from this forum, I now have a table with few synthetic keys. Through one of the combined keys, I now have a PRODUCTLEDGER table linked to the SALESTRANSACTIONDETAIL table, as shown in this data structure. But this seems to be wrong, because I have gaps in my data, that must be fixed through either a different key, or through set analysis.I am not sure that a ledger table should link to a detail table like this, but this is how I removed the loop.
When selecting an item in QV from my list of products, I correctly get the transactions for that product (this comes from SALESTRANSACTIONDETAIL). But, in that same selection,I only get the stock on-hand for the sizes where I had sales. I want to see all stock on-hand for the item, whether we had sales on it or not. I tried this with inaccurate results:
Maybe the real question in this is what must the data structure look like, for a Sales>Sales Detail + order>OrderDetail + Purchase>Purchase Detail + Product + Ledger + Store set of tables.