That is not the case, Query needs to pick all the customers that have balance due "called Open Items".
In my case the query based on 0clear_date. It is checking in the cube whoever customer does not have 0clear_date (means blank) show on the report. But even customer cleared the balance it is still showing as a open item because of first entry of the cube that does not have 0clear_date and 0clear_doc_no. I agree with your logic but lets assume the first entry comes with "O" means open and the second entry comes with "C". But how can i update the first entry with "C". I want to overwrite the status of first entry that's what i am looking for.
Regards,
Shehzad