I am trying to figure out how to have two columns in some sort of table or report where one is drawn from one table and another is matched according to an aggregate on another table. In SQL, this would roughly look like
SELECT a.name, a.target, sum(b.value) FROM TAB1 a, TAB2 b WHERE a.name = b.name GROUP BY a.name
Here, unique names occur once in a but many times in b so that many rows of b match to each row of a.
TAB1
Name. Target
A 1
B 2
C 3
TAB2
Name Value
A. 5
A 3
B 2
C 3
B 6
C 4