Remove Duplicates from String_AGG

,

Make an inner subquery for the parttran table and set it to pull the distinct values you want. Then in your string agg calculation refer to the subquery instead of the parttran table.
Here is a recent example of string agg using a subquery and order by.

string_agg(convert(varchar, cast(SubQuery7.Calculated_RemainQty as int))  + '   ' + convert(varchar, SubQuery7.OrderRel1_ReqDate,1), char(10)  ) Within group (order by SubQuery7.OrderRel1_ReqDate asc)

In this example I set subquery7 to be distinct, which gives a unique list of qty/dates.
Good luck!
Nate