Skip Navigation

[Resolved] Set up checkbox search in views to be "OR" instead of "AND"

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 10 replies, has 2 voices.

Last updated by pamb-2 6 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#668788

Tell us what you are trying to do?

I have a neighborhood violations database. Residents can get notices for 1st violation, and then other for 2nd violation and so on. We change the "Status" field every time we send a violation.

I'm trying to create a Views Parametric search where I can pick several "Status" checkboxes from a single field, and have it return all the results as an OR query. Return results if the record matches ANY of the criteria.

Currently, it seems to be only performing the search of multiple selections as "AND" - It's only returning results if the single record meets ALL the criteria.

The field is "Status" and the single data entry into that field is either "1st" "2nd" and "3rd". If I select each 1st, 2nd and 3rd, I get ZERO records back. I want all records that have either 1st, 2nd or 3rd in the field "Status"

If I select "1st" I get all the records that have "1st" in the status field.

#670857

Hello,

How do you setup the custom field "Status"?

I have tried it in my localhost by below steps, it works fine:
1) Create a custom select field "Status", with options: "1st" "2nd" and "3rd"
2) Create a view, in section "Query Filter", filter by:
Select items with field:
Status is a string in URL_PARAM(wpv-wpcf-status)
I am using comparison "IN" function, it works fine

See similar thread:
https://toolset.com/forums/topic/custom-field-filter-setup/

#673235

The View I'm trying to create is a PARAMETRIC search, there is no, "Query Filter" in this mode.

I don't want ALL results, I want to be able to filter by, or select, for example, all "1st" and "2nd" (but not "3rd") I simplified my example, but there are many more possibilities stored in that field, such as draft, resolved, etc. but I need to select just 1st, 2nd, 3rd, 4th. Or, for example, all "draft" and "resolved".

So this is a parametric search I want to do, on a strings stored in the field "violation-status"

#677031

Here is the document to setup custom field filter:
https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/

Please make sure you are follow above document to setup the filters, if you still need assistance for it, please provide a test site with same problem, I can setup a demo for you.

#706256
Screen Shot 2018-04-21 at 12.05.18 PM.png
Screen Shot 2018-04-21 at 12.03.32 PM.png

As I stated above, this is PARAMETRIC SEARCH and so the documentation at

https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/

DOES NOT match the PARAMETRIC VIEWS screen. Please see the attached screen shot of a my parametric search edit filter dialogue, that does NOT match the documentation you referred me to.

Here is my shortcode, if that can be edited:

[wpv-control-postmeta field="wpcf-violation-status" type="radios" url_param="wpv-wpcf-violation-status"]
#713058
in.JPG

Yes, you are right, the comparison You can try this:
1) Setup the custom search form and filters as your screenshot:
hidden link

Use "Equal to" comparison

2) After that, you can change the comparison in section "Query Filter", see screenshot in.JPG

#715548

Sir, your screenshot is NO DIFFERENT than the screen shot I gave you. I have already done this. I respectfully requeset that this ticket be escalated. There seems to be a communication or language breakdown. You keep telling me to do, what I have already done. You haven't told me how to change the logic to AND instead of ONLY.

#715630

Sir, your screenshot you provided to me, is NO DIFFERENT than the screen shot I gave you! I have already done this! It doesn't give me the result I am asking for!

I respectfully request that this ticket be escalated to another tech. There seems to be a communication or language breakdown. You keep telling me to do, what I have already done. You haven't told me how to change the logic to AND instead of ONLY.

#716038
views-support.jpg

See my screen shot of this query. I do NOT see any way to perform to your instruction here:

2) After that, you can change the comparison in section "Query Filter", see screenshot in.JPG

WHERE on that page, do you click to get a "Query Filter" dialog box? I just don't see it on this page. It's in a regular views editor, however it DOES NOT DISPLAY ON THE PARAMETRIC VIEWS page!

This is the second time I'm informing you, that your instructions don't work on a PARAMETRIC view editor.

#722500

Please try this:
In the top right of your screenshot:
hidden link

Click "Screen Options", enable option "Query Filter", then you will be able to see the "Query Filter" section.

Please let me know if you still need assistance from other supports.

#725783

Now that you told me how to make the Query Filter available on the screen, yes, I can edit the query filter and it's working as I want it to.