Use Left Join or Right Join or Join to join two tables
then use your expression in new table where you can call all the field from existing one i.e Resident table
Your script like
SQL * FROM X;
SQL * FROM Y;
if(not wildmatch([currency code],'EUR'), Amount*currency factor) as NewAmount
Drop table Table1;
1. if u want it to do in th eback end u will have to join the currency code to the accont table with a primary key and bring all details in a sigle table.
2. If u want it to do it in front end keep them linked with a key and u can straight away do it in the front end.
Violume of data defines which way is better.
I would prefer option 1 since it will improve performance.