Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
JGMDataAnalysis
Creator III
Creator III

Relate Payments to Invoices (FIFO method)

Hello everyone!

I need to relate payments to invoices following the FIFO (First In First Out) method, that is, the oldest invoices are settled first.

Initially I tried to solve it by following the steps detailed in the answer marked "solution" in the following thread: https://community.qlik.com/t5/QlikView-App-Development/Help-Needed-On-knock-off-Debit-With-Credit-on...

Although the script does what I need, I cannot use it for my case due to the number of records that my transaction table (Invoices and Payments) has, more than 2 million. In 3 hours he had covered only 10% of the invoices.

I would appreciate guidance to address the problem because I am stuck.

RelacionarPagosFacturas.png

I would like to read the suggestions from: @sunny_talwar@swuehl@rwunderlich,  @hic@Gysbert_Wassenaar ,  @marcus_sommer , @tresesco , @johnw 

Thank you very much to all who like to participate.

I await your comments.

1 Reply
edwin
Master II
Master II

i dont think you have any choice but to use some combination of aggregations, peek function, and loop through your data set

there is a possibility that the payment could be for multiple invoices (its not just multiple payments for single invoices - it becomes many to many). 

i think you need some sort of customized logic to pair the debits and credits.  this may not be achieved by regular table operations using joins.  if QV is slow with the looping logic you may want to move this to your ETL prior to QV load

thats my opinion