Filter the aggregate with multiple same type of attribute ids

Am using an aggregate to get list of record matching with the filter i.e. ToolSubCategoryId from  Entity Tool
If am apply filter Tool.ToolSubCategoryId = 20, it gives me only list of record which are having TooSubCategoryId  value 20.

But I want to get the record with ToolSubCategoryId = 20, 21,22.
Can anyone help me  how to apply filter in aggreate to get the record with multiple same  attribute Ids.

Entities screenshot attached for reference.



Hi Hridesh,

Personally I would go for an advanced query in this case, although there is a way to get what you want using an aggregate, but it's not very good perfomance-wise, so don't use it with very big entities.

You can use the Index()-function. Let's say you have a variable ToolSubCategoryIds, that has value ",20,21,22," (note the first and the last comma's), then you can add a filter
 Index(ToolSubCategoryIds, "," + Tool.ToolSubCategoryId + ",") > -1


Regards,
Lennart

Hi,

Easiest way to achieve this is by creating an additional filter for each id that you want to check or by using the “or” keyword.

Does that help?

That kind of thing you are trying to do is very ineficient. If you need to use a filte rin several ids try to use an advance query and try to use exists instead of IN


if know exacty what ids to search then simply do id = id1 or id = id2 or id = id3 something like this