I know that i will probably have to use Index, Max and Collect. I Just don't know how.
This is the "Registry" table which is going to display the last value, based on the last date, based on the product SKU. Only with "In"s.
And This is the "Movements table" which logs all the data.
(This structure has the objective to record the last price wich the material was purchased.)
As i've said, i tried using Max Collect Index, but with no success.