Filter dataset not working

Hi
I can not get my filter to work on datasets.
Here is a link to my editor if any Wix admins want to take a look: https://editor.wix.com/html/editor/web/renderer/edit/6829c53e-13c8-4435-8422-f9123d87be29?metaSiteId=4647b62d-d504-4fad-b62e-fbc7f65955ce&editorSessionId=0f98e953-37ca-4b97-bd14-6c12ed8b9f77&referralInfo=dashboard

I have a site setup with one database.
In my backend data.js i have this setup
screenshot: Screenshot by Lightshot
this populate a column in my database that is called attKopa with a calculated value.
this seems to work very good and i get the expected results in this column.

then go to a page and opens either a table/list or a repeater and populate them with a dataset and the column attKopa and someone else. Then i set a filter that looks like this:
screenshot: Screenshot by Lightshot
A filter that says “greater than: 0”
When i then run the site i get 3 results out of 10 from my database.
Those 3 results are correct… but it misses several other values that are greater than 0… For example in screenshot2 you can see me selecting what values it picks out to display (2,6,2). But it misses 42,1,2… why?
screenshot1: Screenshot by Lightshot
screenshot2: Screenshot by Lightshot

Why does the filter not work for all values in the column?

Hej där Sverige!
In your last screenshot it seem that you are looking into the values in the data collection view and not the page itself. Please add a screenshot of the repeater that do not page.

Hi Oskar,

I have noticed that if I ignore from the afterQuery() hook, the filter will be worked correctly.
As a result, try to use the hook function beforeUpdate( ). Your fields will automatically be calculated after manually entering the data to the database, and you will get the expected results.

The process will be:

  • Entering to your database the fields (that are not calculated).
  • Press on the plus button to create new item or focused on the calculated fields and press enter.
  • The hook function is triggered and the fields will be updated.

Afterword set the dataset filter.

Have a nice day and best of luck!
Sapir,

Hallå :slight_smile:

Here is a screenshot of the actuall filtering on the page
Tho not really sure what you are asking to see so hopefully i got some picture correct…
You are right that the last screenshot was from the database itself, that was just to display how all values are looking and that not all are being displayed on the page.
http://prntscr.com/lpzl5o
http://prntscr.com/lpzmo1
http://prntscr.com/lpzmty

Hi Sapir
Sadly this did not work.
Now no calculation work for me atall.
http://prntscr.com/lpzrif

Never mind, it does work. It just dident show in the editor and preview. but when publishing it works great now.