Jump to content
Developer Wiki and Function Reference Links ×

Selecting Criteria Using Field Values...


Recommended Posts

Hey guys,

 

Trying to put together a worksheet that selects symbols based on their layer and record fields. A quick overview is we have three 'types' (beam, pole and door) and two 'finishes' (black and silver).

 

To make life bearable for my colleagues, I want them to be able to open the criteria manager and simply change the layer they are referencing. Unfortunately, when drilling down the criteria, if I choose to select 'black' and 'beam', it inserts a pipe instead of an ampersand, causing it to select all items that match 'black' OR 'beam'. I can fix this manually, but whenever the criteria manager is used to change the layer it reverts to using a pipe.

 

Incorrect selection criteria

=DATABASE(((L='MASTER') & (R IN ['Stock']) & (('Stock'.'Finish'='black') | ('Stock'.'Type'='beam'))))

 

Correct selection creiteria (manually edited)

=DATABASE(((L='MASTER') & (R IN ['Stock']) & (('Stock'.'Finish'='black') & ('Stock'.'Type'='beam'))))

 

Link to comment

Unfortunately that is the way the criteria builder works (for now).

 

Criteria of different types (Layer, class, record.field, etc.) are ANDed together.

 

Criteria of the same type (multiple record.field criteria in your case are ORed together.

 

You can either teach your coworkers to manually edit the formula or potentially get a script that can modify the criteria to be what you want.

 

Let us know if you want to explore the script option.

  • Like 1
Link to comment
12 minutes ago, Pat Stanford said:

Criteria of different types (Layer, class, record.field, etc.) are ANDed together.

 

Criteria of the same type (multiple record.field criteria in your case are ORed together.

 

Aha! Seems a little odd. It would make more sense for me to have a drop down on each criteria giving the option of AND/OR. Anyhoo, your explanation worked for me, I simply used the symbol name for the TYPE as I included there as well.

 

Many thanks!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...