How about providing some very small example data, the "format tables" and the desired results.
I cannot see why any "join" is needed without a concrete example.
The example likely only needs two or three variables, the 'formats' in what ever form, 5 or 10 rows of data and desired output for the given example data.
The example PDF isn't very helpful without at least some sort of column header or row header to indicate what any of that stuff is.
BTW, MACRO variables without definitions obscure what you may actually be doing. I have seen some pretty strange things placed into single macro variables.
... View more