Option 1.3. Use a Query as a Range Source
About this task
A query can define a range that is included in any criteria you want. The criteria does not have to be locations. It can, for example, be a list of attributes.
Example
- A range can be orders for computers with selected top-of-the-line features, that are listed in the TADB database as attributes for a Bill of Materials.
- These orders can be identified through a query for those attributes.
- The query that includes the range of features can be used as the range source.
Steps to select a range as a source include.
1 | Open the P1 dialog box. |
2 | Use P1 dialog box features. |
3 | (Optional) Use Expression Browser features. |
4 | (If an existing query range is not acceptable) Configure the named query. |
- Open the P1 dialog box.
Double-click Solve Name in the Set Source Solve function block.
A P1 dialog box opens.
The P1 dialog box provides you with the Browse, add and editing options that other RCO function blocks offer.
- Use P1 dialog box features.
Do any of the following through the P1 dialog box.
Option | P1 Dialog Box | ||
Solve Name |
Identifies the named query to:
|
||
Browse buttons | Opens the Expression Browser | ||
Popup Menu button | Displays the popup menu | ||
Selections are: | |||
New | Opens a New Expression dialog box. 1. Enter a name for the new query. 2. Click OK. Opens the Expression Editor. | ||
Edit | Opens the Expression Editor for a query that is entered in the Solve Name field. | ||
Browse | Opens the Expression Browser. | ||
Recent named queries | Uses the named query that is selected in the list. | ||
OK | Closes the P1 dialog box; displays the named query as the parameter value. |
- Use Expression Browser features.
If you opened the Expression Browser you can use the same steps to create or edit a query as you would for any query.
- Configure the Query range.
- Use the Expression Editor syntax to create or edit an expression that will determine what items will be included in the range.
Example
- The computer factory has a class of computers called CLASS 1.
- The computers have a 19" monitor, ergonomic keyboard and are not blue in color.
- A CLASS1 query will select all of the purchase orders that list these attributes.
- The selected orders will be the orders in the query range.
- Apply the query and close the Expression Editor when the expression is ready.
The Expression Browser opens.
- Select the Query.
- Click OK.
The P1 dialog box opens with the named query in the Solve Name field.
Procedure
Results
The named query displays as the value for the Range Name parameter.