So, the issue comes when I try to display the sales from 2017-02-16 to 2017-02-17. I got 24.68, its true because QV has loaded 2 sales (above rows). I have created a unique key - " Storehouse_ID & '|' & onDate & '|' & Customer_ID as TestKey "
But, I want to implement this logic:
if current sale ( which I load ), matches my TestKey, check if I have already loaded a sale with the same TestKey and
if current sale has Invoice 1 and the previous sale has bill_goods 1 -> delete the previous sale
else just load the current sale
Here is how I load the table and create a unique key:
Could you please clarify your requirements by making more example data that show the logic. I can't figure out what you mean without having some more rows of data showing exactly what you read and the results you want to happen after the logic has been applied.
Do you read two source tables or is it only one table from a single QVD?
What do you mean by "current sale" do you mean current record/row that you are reading from a QVD?