In a load script, it's not possible to refer to columns in other tables, like in chart expressions. You have to join the tables first, and after that, you can create calculations with these fields in the joined table.
Probably you will have to create several blocks, each one calculating a KPI and after that concatenate all the resulting calculations in one single table.