Create a Query - Intergraph Smart Instrumentation - Help

Intergraph Smart Instrumentation Help

Language
English
Product
Intergraph Smart Instrumentation
Search by Category
Help
Smart Instrumentation Version
13.1
  1. Open the Reference Explorer and locate the Queries folder.

  2. Open the Queries folder, right-click on the Query Builder folder and on the shortcut menu, click New > Query.

  3. On the Query Properties (New) dialog box, type a name for the query in the Name field.

  4. Add a description if required.

  5. Select the Suppress Repeating Values check box, if you don't want to display in the grid values that are repeated more than once. For example, when the query involves wiring and their connections.

  • When working with a Microsoft SQL database, selecting Suppress Repeating Values in combination with Note fields, causes the query/EDE to display incorrectly.

  • When any of the following Note attributes belonging to specific Item Types are included in your query, the complete EDE appears blank.

    Item Type

    Attribute Category

    Attribute

    Instrument

    General Properties

    Instrument Note

    Loop

    Identification

    Loop Note

    Panel

    General Properties

    Panel Note

    Process Data (Shared)

    General

    Calculation Sheet Program Notes

    Process Data Sheet Notes

    Spec

    Spec Sheet

    Spec Note

    Maintenance Event Activities

    Custom Fields

    Work Activity Text — User Defined Fields (UDFs) 001, 002, and 003.

  • When adding one of these Note attributes, when the software detect that it is not compatible with your query a message is displayed on the screen, but the software does not remove the attribute from the query, this you must do manually.

  • Browser views that were converted to EDEs after upgrading from version 2013 that include any Note field, appear completely blank when opened. To correct these issues, in the Edit EDE Definition dialog box clear the Suppress Repeating Values check box.

  1. Click OK.

  2. In the Query Builder, from the Item Type Explorer drag and drop the required items to the Definitions window.

    • You can double-click on an item to add it to the Definitions window.

    • You can right-click on an item in the Definition pane and from the shortcut menu click Add relation to, followed by the required Item Type.

    • The order that you add items to the Definition pane effects the final results of the query. You could select the same two items but add them in a different order and receive a different result.

    When creating relations between plant groups, make sure you start building the hierarchy from the Lowest Plant Group, and work your way up to the Highest Plant Group. Building the hierarchy in any other way does not populate the correct results in the Query Preview.

  3. Right-click Relationship DB Icon to open the Relations dialog box.

  4. From the Relation list, select the required relationship.

    Certain relationships have only one choice available, for example Instrument to Loop, others have many, for example Instrument to Panel displays a list with all the different panels that can be related to an instrument, Junction Box, Device panel, Marshaling Rack, and so forth. To see in the EDE view those instruments with junction boxes for example, you would select the relationship Instrument - Junction Boxes.

  5. In the Method group box, select the required Method. There are three options to choose from:

    • Display only X [Item Type] records and Y [Item Type] records that are related — Displays all the rows where each side of the relationship has data.

    • Display all X [Item Type] records and only those Y[Item Type] records that are related — Displays all the records from row item type X even if there is no relationship to row type Y, but only displays related records from row Y.

    • Display all Y [Item Type] records and only those X [Item Type] records that are related — Displays all the records from row Y even if there is no relationship to row X, but only displays related records from row X.

    • Selecting the correct relationship method is an important factor in your query returning the correct information. Therefore it is recommended that if you are uncertain as to which method to choose, select Display only X [Item Type] records and Y [Item Type] records that are related.

    • When working with complex queries (three or more item types), it is recommended to use the same relationship method for the entire query.

  6. Click Close or click outside the Relations dialog box to close the dialog box.

  7. If required, right-click on an item in the Definitions window and from the shortcut menu do one of the following:

    1. Clear Exclude empty rows, we recommend keeping it selected.

      • The Exclude empty rows option, is by default selected on the first item you add to the Definition. Only one item within a query can have this option active. If you choose to select Exclude empty rows for another item type, the original Exclude empty rows is cleared. The item type that has this option activated displays the following QB Exclude Empty Rows.

      • Exclude empty rows is not available for the three Plant Group Item Types; (highest, intermediate, and lowest) instead you can choose Only query from this level where the query only collects data from current logged-in plant level.

      • Specification and Process Data Item Types do not include the Exclude empty rows option.

    2. Select Add relation to, to display a selection of item types that you can relate the selected item with. Selecting an item from the list displays the item in the Definition window.

      The list of items displayed varies and contains only items that are relevant to the selected item type.

  8. Select an item type from the Definitions window, and from the Attribute Explorer double-click the attribute you want to use in your query. Repeat this process for other attributes for the selected item type or change the item type and select attributes for the new selected item type. The attributes are added to the Query Attributes tab.

    When you select an item from the Definitions window, the items attributes are displayed in the Attribute Explorer. By default, when you add an item type to the Definitions window, if the selected items attributes contain the attribute Name then that attribute is automatically added to the Query Attributes tab. For example, selecting Instrument in the Definitions window displays the instrument attributes and automatically adds the attribute Instrument Name to the Query Attributes tab. There are some Item types that do not have an identifying name.

  9. Click the Query Attributes tab where you can do the following:

    • Type a name in the Attribute caption name, to replace the Attribute name in the column header. If left blank the software uses the attribute name.

    • Rearrange the order of the attributes by dragging and dropping the attributes from one position to another in the Attributes tab.

    • Clear or select the Display Attribute check box (by default Display Attribute is selected). When cleared the attribute is still displayed in the query preview but when you generate an EDE from the query, the attribute is not shown, even though the attribute's data is still used.

      Sort parameters applied in a query to an attribute's values, that are defined as invisible (Display attribute check box is cleared), are not taken into consideration in the generated EDE. We recommend that if you apply sort parameters to an attribute's values in a query, that the attribute is not defined as invisible. If you do not want to see an attributes values in the EDE report, you can specify which EDE columns to include in the report when printing. For more information, see Print Multi-Header Report from an EDE View.

    • Remove an attribute from the query by clicking on the Remove QB Remove Attribute.

  10. Click the Query Preview tab.

  11. Click QB Generate Preview to create or refresh the query preview.

    SHARED Tip After generating a preview, you can use the Search field to search the preview and make sure the query contains the data you want in the EDE.

  12. Click .

SHARED Tip You can close the explorers, the Query Attributes tab, and the Query Preview by clicking on the Close Close icon of the respective pane. To open them again, select the appropriate menu command from the Query Builder menu. Closing the Definition window closes all the components of the Query Builder.

When creating a Specification or Process Data query, the software displays blank rows as well as the data required in the grid. This is due to limitations within the software.

To display just the required data without the empty rows, you must add the following attributes to your query:

  • For a Specification query – Form Name attribute

  • For a Process Data query – Fluid State attribute

After adding the specific attribute to the query, you then apply the Is Not Null filter to the attribute. When you generate the query, only rows with the correct data are displayed.

  • If you save the query after applying the filter, when you generate an EDE view from the query, the filter is applied to the EDE, resulting in the correct data being displayed in the EDE view.

  • You can apply the Is Not Null filter after generating the EDE view if you prefer.

  • Not every item type has a Name attribute, for example Connection items. When an item type has a Name attribute and is added to the Definition, the Name attribute is automatically added to the Query Attributes tab.

  • When an item type with no Name attribute is added to the Definition window it is not possible to save the query until an attribute is added to the Query Attributes tab.