Hello,
There are
IN and
NOT IN functions in SQL language for comparison between two fields, so your macro needs to return strings with document names separated with commas:
WHERE condition: DocumentName IN ('Test', 'Lorem', 'Ipsum')
or (and I suggest you the following one)
you don't need to implement your own custom macro and you can write another
SELECT into
IN function, which selects you document names from your document tree:
WHERE condition: DocumentName IN (SELECT DocumentName FROM View_CMS_Tree_Joined WHERE SiteName = 'CorporateSite')
Best regards,
Jan Hermann