The substring function will work just fine. The problem may be in the LEFT TABLE IDs.
The left one looks like a table chart (not a regular table object). So I suspect there is a measure to it which may be hidden or cropped out of the picture. (if you create a list box with the Left-table-ID field you will see all values you truly pick in your Concat function)
What you see on the front end is not the entire set of "Left Table ID"s but just the ones that generate some non-zero value of the hidden expression.
Ringo, did Stoyan's last post get you what you needed to get a working solution? If so, please be sure to return to the thread and use the Accept as Solution button on his post to give him credit and let other Community members know it did work. Regarding the AGGR side of things, Do a search on AGGR in the following link and check out those posts, as they may be helpful in your use case, was not sure which one(s) might be most helpful.
To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question. I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.