Hi,
The easiest way to debug this is to extrapolate the results of the macro into your query. If I'm understanding your post correctly, what you have so far would look like this:
[Database Layer].[Orders].[Exclude_These] not in HR,IT,Purchasing
This is not legal syntax - the list of items should each be in single quotes, and the entire list should be within parentheses - something like:
[Database Layer].[Orders].[Exclude_These] not in ('HR','IT','Purchasing')
Take a look at the CSVIdentityName macro function - will this return an appropriate result?
Regards,
MF.