Second filter with !=NA does not work

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
Post Reply
jachmovi
Posts: 3
Joined: Fri Apr 07, 2023 7:17 am

Second filter with !=NA does not work

Post by jachmovi »

Hi everyone,

I have a problem filtering missing values. To show you, I made an example data spreadsheet in jamovi. In this data set I have two variables, A and B with some missing values. If I filter them like this, it works:

Filter 1: A !=NA
Filter 2: B !=2
Bildschirm­foto 2023-04-07 um 09.12.17.png
Bildschirm­foto 2023-04-07 um 09.12.17.png (15.89 KiB) Viewed 2087 times
But what I want to do is filter missing values of variable A in the first filter and missing values of variable B in the second filter, like this:

Filter 1: A !=NA
Filter 2: B !=NA

But then filter 2 is not working.

Bildschirm­foto 2023-04-07 um 09.12.50.png
Bildschirm­foto 2023-04-07 um 09.12.50.png (16.99 KiB) Viewed 2087 times
Can someone explain to me why that is and how I could fix it?

Of course, there is the option to put the first filter like this:
Filter 1: A !=NA
and B !=NA

Then it works!
Bildschirm­foto 2023-04-07 um 09.54.59.png
Bildschirm­foto 2023-04-07 um 09.54.59.png (15.71 KiB) Viewed 2087 times
But because I have a more complex case in real life, where I need the option to put the filter on and off seperataly, this sadly isn't an option for me.

Thank you very much for your help and any ideas on how to fix this.
User avatar
MAgojam
Posts: 422
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: Second filter with !=NA does not work

Post by MAgojam »

Hey @jachmovi,
maybe this tip (screenshot) could help you.

It is a listwise filter for the missing with the variables of interest.
Quick and easy to add or remove variables.
ScreenShot_20230407190118.jpeg
ScreenShot_20230407190118.jpeg (178.31 KiB) Viewed 2074 times
Cheers,
Maurizio
jachmovi
Posts: 3
Joined: Fri Apr 07, 2023 7:17 am

Re: Second filter with !=NA does not work

Post by jachmovi »

Hey Maurizio,
thank you so much, this helps a lot! 
So instead of 
Filter 1: A != NA
Filter 2: B != NA
I just wrote
Filter 1: IF (A)
Filter 2: IF (B)
and it works just as I wanted it to.
I still don't get why the first way doesn't work, but the problem is solved.
Thanks again, you saved my day!
User avatar
reason180
Posts: 278
Joined: Mon Jul 24, 2017 4:56 pm

Re: Second filter with !=NA does not work

Post by reason180 »

It seems to me that there's something wrong with how jamovi handles filtering that references NA. Below, the top screenshot shows an improper result when NA is referenced, but the bottom screenshot shows a correct result when a different approach is taken--one that does not reference NA.
Attachments
filterfilterPicture4.png
filterfilterPicture4.png (115.32 KiB) Viewed 2061 times
User avatar
jonathon
Posts: 2627
Joined: Fri Jan 27, 2017 10:04 am

Re: Second filter with !=NA does not work

Post by jonathon »

if you could create an issue over at https://github.com/jamovi/jamovi/issues that would be great.

with thanks
jachmovi
Posts: 3
Joined: Fri Apr 07, 2023 7:17 am

Re: Second filter with !=NA does not work

Post by jachmovi »

Thank you @reason180, for replicating this issue and showing another alternative way to get the desired outcome.

@jonathon I have created the issue as wanted.

Best
Post Reply