Creating Queries

When you create or open a query, it is displayed on a named tab.

The query wizard is used to define the parameters and criteria for the query. The wizard content is organized across Source, Style, Filters, and Columns tabs to guide input. Although the wizard tabs are ordered to gather input in a sequence, you can navigate between any tabs.

To create a query:

  1. On the Home page, select Query.
  2. Click New Query toolbar button.
  3. Optional: Create substitution parameters for the query to pass in user-defined values to the query filter at run time.
    1. Click Add Parameters button.
    2. Click Add and add Key-Value pairs.

      Note:

      Key-Value pairs cannot use "<%" or "%>" sequentially or an equal sign.

    3. Click OK.
  4. From the Source tab, select a version or version variable for the query.

    You can select Normal, Baseline, or As-Of versions. The Version list defaults to the Normal versions. To select a Baseline or As-Of version, click Normal under the Version list.

  5. Perform an action:
    • For a global query, go to the next step.

    • For a local query, click Ellipsis button, select a hierarchy and a top node and click OK

      Note:

      To change the hierarchy/top node combination, click Clear and then repeat the steps for a local query.

  6. On the Style select how the query results are displayed:
    • List — Nodes that match the criteria are returned in a dynamic list.

    • Mark Nodes — Nodes that match the criteria are marked in the hierarchy tree.

    • Both — Nodes that match the criteria are returned in a dynamic list and marked in the hierarchy.

    Note:

    For global queries, the results can be returned only in a list.

  7. Optional: If you selected Mark Nodes or Both, select Expand to Marked Nodes to automatically open and expand hierarchies with marked nodes.

    Note:

    This option is applicable only to local queries.

  8. On the Filter, click Add to insert a criteria row.
  9. Select a property and operator, enter a value or substitution parameter for the criteria row, and press Enter to save the row.

    Note:

    Substitution parameter formatting is <%ParamKey%>, where <% and %> are the identifiers that note a runtime substitution variable and ParamKey is the name of the parameter to be used for substitution for example, <%AccountType%>. You can include parentheses to group criteria and to define whether to include inherited values for the property. For operator descriptions see Operator Descriptions.

    Tip:

    Click edit button to modify a row. Click delete button to delete a row. Click the arrows to move a row.

  10. From Include Options, select the nodes to include in the query results:
    • Match Only — Returns only the nodes that match the criteria

    • Match and Ancestors — Returns all nodes that match the criteria, plus their ancestors

    • Match and Descendants — Returns all nodes that match the criteria, plus their descendants

  11. Optional: If you selected Match and Ancestors or Match and Descendants in step 9, by default, the Inclusive option is selected and includes the node matching the criteria in the result.
  12. Optional: If you selected Match and Ancestors in step 9, you can select Include ancestors above query top node to include ancestor nodes that are above the top node.

    The Include ancestors above query top node option includes additional ancestors only if the top node specified for the query did not include all ancestors (Match and Ancestors option). Thus, this option has no effect on descendants (Match and Descendants option).

  13. Select the Columns tab and choose a Category.
  14. Select the properties to display as columns in the query results and move them from Available to Selected.

    Note:

    The Name property is always displayed in query results regardless of what properties are selected to display.

    Column selections are runtime parameters only and are not saved with the query.

    Tip:

    Use the arrows to position the column in the Selected list. The first item in the list is the first column, the second item in the list is the second column, and so on.

  15. Optional: Select Include Criteria Properties to automatically include properties referenced in the filter criteria in the query results.
  16. Do any of the following:
    • Click Save button to save the query.

      You are prompted to define a name, description, and an object access group for the query. Select a custom object access group or one of the following:

      • User––Personal objects that are available only to an individual user to view and run.

      • Standard––Public objects that are available to all users to view and run. Only Data Manager users can create and modify standard queries.

      • System––Restricted objects that are available only to Application Administrator role users to view and run.

    • Click Run button to run the query.