Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Changing AND to OR in "Edit Find Request"


This topic is 2967 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have the following fields in a table (classical music):
Category
Category 2
instrument 1
instrument 2
instrument 3
instrument 4
I would like to make a script that export to the following conditions:
IF "category" OR "category 2" contains "Instrument" then output the contents of "Instrument 1", "Instrument 2", "Instrument 3" and "Instrument 4".

If I add two or more conditions the default is AND. How do I change this to OR?

and_or.jpg

Edited by Kurt Hansen
Link to comment
Share on other sites

35 minutes ago, Kurt Hansen said:

IF "category" OR "category 2" contains "Instrument"

This problem is a symptom of another. Any time you find yourself numbering your fields, like "Category 1", Category 2", etc. you should consider using a related table instead. Even a repeating field, or a single field formatted as checkboxes, would be preferable to what you have now.

Link to comment
Share on other sites

44 minutes ago, webko said:

Do it as two find requests, rather than combining them in one as per above.

Thanks, Webko, but...!

I want it to output only if "Kategori" or "Kategori 2" contains the word "Instrument". My test (see attachments) doesn't do that.

Example: Catalog number BRIDGE 9450 outputs "Kammermusik   Klaver   Klaver   Klarinet    Fagot".

In my database "Kategori" contains "Kammermusik" and "Kategori 2" contains "Instrument".

dump1.jpg

dump2.jpg

Link to comment
Share on other sites

10 minutes ago, comment said:

This problem is a symptom of another. Any time you find yourself numbering your fields, like "Category 1", Category 2", etc. you should consider using a related table instead. Even a repeating field, or a single field formatted as checkboxes, would be preferable to what you have now.

Yes, comment, I believe that, but it would be quite a work for me to "split" my data into two tables. I have 35.000 records in my current flat database AND I'm a novice ;-)

Link to comment
Share on other sites

7 minutes ago, comment said:

Why does your test have four find requests instead of the suggested two?

I'm sorry, I do not know. It is as I had seen the proposal. Which 2 of the 4 should I keep?

[Edit] Ok, comment. I'm working and I think I'm going the reght way now.

Edited by Kurt Hansen
Link to comment
Share on other sites

3 minutes ago, Kurt Hansen said:

Which 2 of the 4 should I keep?

If you want to search the "Kategori" and"Kategori 2" fields, then those are the requests you should keep (#1 and #3 in your screenshot).

I am a little confused by your original requirement:

1 hour ago, Kurt Hansen said:

IF "category" OR "category 2" contains "Instrument" then output the contents of "Instrument 1", "Instrument 2", "Instrument 3" and "Instrument 4".

The result of performing a find is a found set of records. It does not "output" any particular fields. Does your find need additional criteria regarding the "Instrument" fields?

Link to comment
Share on other sites

Why don't you try an easier (IMHO) way:

Enter Find Mode [  ] 
Go to Layout [ “YourTable” ] 
Set Field [ YourTable::Category; "instrument" ] 
New Record/Request 
Set Field [ YourTable::Category2; "instrument" ] 
Perform Find [  ] 

Note that no find requests are specified for the Enter Find Mode [ ] or Perform Find [ ] steps.

 

 

Link to comment
Share on other sites

Comment,

I see you go into find mode before switching layouts. I assume you are doing this to prevent the new layout from retrieving records that are not needed for the task at hand but could the same thing be accomplished with Freeze Window as the first step?

Just curious. 

Link to comment
Share on other sites

On 18/8/2016 at 1:12 PM, comment said:

Why don't you try an easier (IMHO) way:


Enter Find Mode [  ] 
Go to Layout [ “YourTable” ] 
Set Field [ YourTable::Category; "instrument" ] 
New Record/Request 
Set Field [ YourTable::Category2; "instrument" ] 
Perform Find [  ] 

Note that no find requests are specified for the Enter Find Mode [ ] or Perform Find [ ] steps.

How do I select two fields in line 3 and 5?

Link to comment
Share on other sites

14 minutes ago, Kurt Hansen said:

My database is flat with only one table. I havn't got tables called "Category" and "Categori 2".

You must use fully-qualified field names in a script, in the format of TableName::FieldName. My script presumes your table is named "YourTable" - replace this part with your real table name.

 

14 minutes ago, Kurt Hansen said:

I must select both "Category" + "Instrument" (and "Category" + "Instrument").

I don't understand this part. Do you also want to search the Instrument field (or rather fields, since you have 4 of them)?

 

Note that this is the same question I asked earlier:

On 08/18/2016 at 9:22 AM, comment said:

I am a little confused by your original requirement:

...

Does your find need additional criteria regarding the "Instrument" fields?

 

 

Edited by comment
Link to comment
Share on other sites

7 minutes ago, Kurt Hansen said:

How to select?

Just click OK and Filemaker will insert the field name for you. It will look like this: Varer::KATEGORI. Then click the Calculated result: Specify button and enter the text "instrument" (including the quotes) as the calculation formula.

These are basic script operations; you should know them after having done the tutorial and/or consulting the help.

Link to comment
Share on other sites

29 minutes ago, comment said:

Just click OK and Filemaker will insert the field name for you. It will look like this: Varer::KATEGORI. Then click the Calculated result: Specify button and enter the text "instrument" (including the quotes) as the calculation formula.

These are basic script operations; you should know them after having done the tutorial and/or consulting the help.

Aha! Got it. Thanks.

Yes I know that I should (...) but my needs are very modest and irregular; usually just a few times a year. I am not unwilling to make an effort itself, but my experience is that even a very conscientious review of a tutorial is not stored in my memory, so I can remember it next time.

Link to comment
Share on other sites

This topic is 2967 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.