What about substring() instead of concat() or adding a column for the nid in ppc and pmc?

Cheers,
tim