Qlik will do it correctly if you make sure that both the date and the ID are used to join or associate (link) the two tables. To be able to do that both the fields must be named the same in the two tables. A join in the load script where you rename for instance ReferenceDate.YearMonth to just PaymentDate.YearMonth when you bring in the tables and before the join will do the trick.
In a load script it would look like:
ReferenceDate.YearMonth AS PaymentDate.YearMonth,
Qlik has to rely on a natural join where all the fields that should match have to have corresponding names in the two tables.