Filter not working on calculated data

I have a table with a calculated column (created with an afterQuery hook) named “Category”.
When I trying to filter on with this simple code, it I get nothing for result.

$w(“#dynamicDataset”).setFilter( wixData.filter()
.contains(“Category”, “abc”));

If I set any other column in the code instead of this calculated one it works fine, so it seems calculated column’s behavior is different than the simple input data in tables.

Anybody has idea how can I filter on calculated column in a table?

Thanks!

Hi,
The afterQuery hook is triggered either by a dataset reading data from a collection, setting a filter on a collection and after doing a query. The reason is that every action (dataset read, set filter, query) produces a query which happens in the background.

This means that the hook runs and manipulates the data a number of times, which may produce unexpected results.

Depending on your specific setup, consider using a different hook type or change its code to take into consideration the fact that the hook may run a number of times.

Oh clear, thx!