Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Joining tables without a key?

Hi,

I need to calculate the time between deposits and withdrawals in a savings account. I have a table with deposits and a table with withdrawals. The difficulty lies in matching up the two tables based on first in, first out logic rather than a primary & foreign key.

As an example, if a customer deposits $500 in January 2010, and withdraws $500 in January 2011 the time attached to that $500 is 1.00 years. Ultimately, the script needs to calculate the duration of each deposit in each account, which can then be aggregated into deposit categories like money market accounts and IRA accounts.

The difficult part of the script is matching up deposits and withdrawals on a first in, first out basis. Plus, the amount of one withdrawal usually doesn’t match the amount of its matching deposit. The good news is that deposits are always >= withdrawals, in total.

An example with starting data and what the end result could look like is attached.

Thanks in advance for your help!

Ted Price

Colorado Springs, CO

0 Replies