Thank you for looking into it and I am sorry I probably have not explained it correctly in the original post.
The first table Departments contains indeed employee cost code/ department history and 2nd table "Salaries" salary details.
The common values for both are the employee reference (payroll number, EMPREF) and pay date (date, ORD5).
As employees might move from one department to another, the date field show department value for each pay date and salary table salary paid in the same period.
Is there a way to link both tables on both values employee reference and pay date to sum salary value by a department by and by date?
Yes you can combine the two fields using
1 - either directly with a delimiter (e.g. field1 + '|' + field 2) on each table as a linking key
2 - using an autonumber / autonumberhash function (https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/CounterFunctions/autonumberhash256…)
autonumberhash256(PayrollNumber, num(date(paydate, 'yyyymmdd'))) as %linkKey