When I add DISTINCT to the Primary query, along with the Top Count enabled, I get an error:
Error on Primary Select: Incorrect syntax near the keyword 'DISTINCT'.
The SQL output is as follows:
PRIMARY SELECT:
Select
TOP 100 DISTINCT dbo.KB_XMod_ExtractFieldValue(InstanceData,'ContactName') AS Contact, T1.[XmodID], T2.[key], T2.[value] AS Category
From ....
Why is it not inserting TOP 100 after distinct?