Querying attributes
You can use the Longview Add-In for Office to query attribute data from the data server repository.
In this chapter, you can find information on attribute query tasks, including the following:
- “Understanding attribute query output”
- “Querying attribute information”
- “Rerunning an attribute query”
- “Saving and loading attribute query selections”
Understanding attribute query output
An attribute describes the characteristics of an object in the application. You can use the Longview Add-In for Office to query System, User, or Symbol attributes from the Longview data server repository. When you run an attribute query, the results of the query are output to a Microsoft Excel workbook. The attribute query results appear in the following layout:
The following format is applied to attributes in the query results:
- The first row for a different User or Symbol attribute displays with a gray background.
- Multiple attributes are sorted by the attribute name in the query results, in alphabetical ascending order. Since attribute query results for User or Symbol attributes can return multiple attribute values for each User or Symbol object (with each attribute value displayed on a separate row), this provides you with a visual indicator to distinguish between separate attributes.
- In addition, the columns displayed in the attribute query results vary depending on the option selected for Retrieve.
- If Values was selected, see “Understanding attribute values query results”.
- If Definitions was selected, see “Understanding attribute definitions query results”.
Understanding attribute values query results
Attribute queries that are set to retrieve attribute values display the following columns in the query results:
Column | Description |
---|---|
Class_Name | The attribute class. Possible values for Class_Name include the following:
|
Attribute_Name | The name of the attribute. |
Attribute_Description | The description of the attribute. |
Attribute_Type | The type of data value that can be specified for the attribute, and whether the attribute will accept a single value or a list of values (in which case the attribute type is appended with List). Possible values for Attribute_Type include the following: Date, Date List, Double, Double List, Integer, Integer List, String, String List, Symbol, and Symbol List. |
Object_Name | The name of the attribute object.
|
Attribute_Value | The numeric or string value that the attribute is set to. If no value is set for the attribute, the column is left empty. |
Same_as_Default | Indicates whether the value the attribute is set to is the same as the default value for the attribute. Possible values for Same_as_Default include the following:
|
Understanding attribute definitions query results
Attribute queries that are set to retrieve attribute definitions display only the following columns in the query results:
Heading | Description |
---|---|
Class_Name | The attribute class. Possible values for Class_Name include the following:
|
Attribute_Name | The name of the attribute. |
Attribute_Description | The description of the attribute. |
Attribute_Type | The type of data value that can be specified for the attribute, and whether the attribute will accept a single value or a list of values (in which case the attribute type is appended with List). Possible values for Attribute_Type include the following: Date, Date List, Double, Double List, Integer, Integer List, String, String List, Symbol, and Symbol List. |
Attribute_AccessType | Indicates whether users can set values for the attribute. Possible values for Attribute_AccessType include the following:
|
Attribute_Value | The numeric or string value that the attribute is set to. If no value is set for the attribute, the column is left empty. |
Querying attribute information
When querying attribute data, you have the option of querying an entire attribute class, multiple attributes, or a single attribute.
Longview recommends that you place one query per worksheet in Microsoft Excel. However, if you must run multiple queries and place them in a single Microsoft Excel worksheet, ensure that the query results do not overlap.
To query attributes:
- Click the Longview tab.
- In the Insert group, click Attribute Query. The Attribute Query dialog opens.
- Complete the following fields:
Field Description Class
Select the class of attributes that you want to query, using one of the following options from the drop-down list:
- System—To query System attributes. System attributes specify system-wide characteristics. There is only one object in the System attribute class—the application itself.
- User—To query User attributes. User attributes describe the attributes of a particular user. Each user is an object in the User attribute class.
- Symbol—To query Symbol attributes. Symbol attributes describe the characteristics of individual symbols. Each symbol is an object in the Symbol attribute class.
Retrieve
Select the type of attribute data that you want to query, using one of the following options from the drop-down list:
- Values—To query attribute descriptions and values.
- Definitions—To query attribute definitions only.
The default value for this field is Values.
Cell Location
Type the location of the top left cell of the query results. Keep in mind that the query results overwrite any existing data in the worksheet cells.
- By default, all attributes in the specified class are selected. If you do not want to query all attributes, click the Select All check box in the header row to deselect all attributes, and select the check box adjacent to the attributes that you want to query.
Note: To search for specific attributes to query, type the attribute name or description in the Search Attributes field. The first matching attribute is selected. To find the next matching attribute, click Next.
- Click Run Query. The results of the attribute query appear in the worksheet.
- Click the File tab.
- Click Save.
- If you are saving the workbook for the first time, the Save As dialog opens. Enter a name for the workbook and click Save.
Rerunning an attribute query
You can use the Longview Add-In for Office to rerun an existing attribute query. Rerunning an attribute query refreshes data values in the query and allows you to modify the query as necessary.
When you open a workbook containing attribute queries, the associated values are not updated to show the latest values in the Longview data server repository. The data will be exactly the same as when you last saved and closed the workbook. To see the most up-to-date data from the data server repository, you must rerun your attribute queries.
To rerun an attribute query:
- Right-click any cell in the results of the attribute query that you want to rerun and select Rerun Query. The Attribute Query dialog opens.
- Make any changes to the attribute query as necessary.
- Click Run Query. The results of the attribute query appear in Microsoft Excel, with refreshed data values and any specified changes.
Note: Any formatting (font, borders, or alignment for example) in the worksheet is retained when you rerun an attribute query. This includes the formatting automatically applied to existing attribute query results.
Saving and loading attribute query selections
You may save the query selections that you have selected in the Attribute Query dialog. This will enable you to quickly pre-populate the Attribute Query dialog in the existing session or within a future session.
The query selections are saved to a file. You can name and save the file in a local or network drive. This enables you to give the query a meaningful name and the ability to share your query with others.
Saving attribute query selections
To save your query selections, you must first specify the selections you wish to save in the Symbol Query dialog. For more information, see “Querying attribute information”.
To save symbol query selections:
- Complete the fields in the Attribute Query dialog.
- Click Save Query.
- The Save As dialog opens.
- Enter a name for the query and click Save.
Loading attribute query selections
You may quickly pre-populate the Attribute Query dialog with selections from a saved query.
To load attribute query selections:
- Click the Longview tab.
- In the Insert group, click Attribute Query. The Attribute Query dialog opens.
Note: You must be connected to the data server to run an attribute query.
- Click Load Query. The Open dialog appears.
- Select the query file that you wish to load and click Open.
- The fields of the Attribute Query dialog are populated with the query selections from the selected file.
You may modify these selections before running the query.