You can try to pivot your resultant table:
q)tt:flip`c1`c2`vals!(`a`a`x`x;`b`y`y`t;100 200 300 400)
q)tt
c1 c2 vals
----------
a b 100
a y 200
x y 300
x t 400
q)0^exec (distinct tt`c2)#c2!vals by c1:c1 from tt
c1| b y t
--| -----------
a | 100 200 0
x | 0 300 400
You can look at Pivot Table for more information.