Hello J.
I'm testing in a personal.
Here is the Data Model:
Here is the Sources from the aggregate:
And here what is in the Filter and the test.
Here is the complete QUERY as it is executed by the system. You will notice that there is no WHERE clause:
SELECT TOP (32) ENCompetency.[ID] o0, ... FROM (([X2PXKM031].DBO.[OSUSR_9BL_WORKER] ENWorker Left JOIN [X2PXKM031].DBO.[OSUSR_9BL_FUNCTION] ENFunction ON (ENWorker.[FUNCTIONID] = ENFunction.[ID])) Left JOIN [X2PXKM031].DBO.[OSUSR_9BL_COMPETENCY] ENCompetency ON (ENWorker.[ID] = ENCompetency.[WORKERID]))
In the test above, the only line that should be showing in the results is the line where the Name is 'Ricardo', but as there is NO where clause generated, all the lines are showing up.
If I replace all the search variables in the filter by, for example, var1, than it works as expected:
And the executed query is very different, presenting the WHERE clause:
SELECT TOP (32) ENCompetency.[ID] o0, ... FROM (([X2PXKM031].DBO.[OSUSR_9BL_WORKER] ENWorker Left JOIN [X2PXKM031].DBO.[OSUSR_9BL_FUNCTION] ENFunction ON (ENWorker.[FUNCTIONID] = ENFunction.[ID])) Left JOIN [X2PXKM031].DBO.[OSUSR_9BL_COMPETENCY] ENCompetency ON (ENWorker.[ID] = ENCompetency.[WORKERID])) WHERE (((ENWorker.[NAME] LIKE ((N'%' + @Var1) + N'%')) OR (ENFunction.[NAME] LIKE ((N'%' + @Var1) + N'%'))) OR (ENCompetency.[NAME] LIKE ((N'%' + @Var1) + N'%')))
I would say that there is something wrong with the SQL generator of the aggregate in the first case, as I am not seeing a reason to it to generate the first query.
Cheers,
Eduardo Jauch