Defining queries

Related videos Training course

Important! Poorly written queries can cause performance issues in iMIS.
Before starting to work with queries in the Intelligent Query Architect, review the Best practices for writing IQA queries.

Intelligent Query Architect is a query-building tool that extracts data from the iMIS database. It simplifies query-building tasks by providing a user-friendly interface that enables a user with limited SQL experience to build queries and reports.

See Reporting in IQA for information about using queries for reports.

In This Article 

Essentials of query definition

  • Name the query: Follow a structured naming convention to make queries easier to locate.
  • Add source(s) for the query: Add one or more sources (business objects or queries) for the query. For example, you could set up a query based on the Contacts business object alone, or on both Contacts and Activities, or on a previous query with an additional source.
  • Use existing relationships between sources or create new ones: If you have chosen more than one source for your query, there must be relationships between the sources. The most common relationships are used by default. However, you might need to create new relationships. You can associate business objects and queries through fields that contain the same data.
  • Important! Cross Joins should rarely be used, if at all. Cross Joins create performance issues and could cause your site to run slow.

  • Set filters to narrow query results: Use logical operators (such as Equal, Not Equal or Between, for example) to refine query results. When you define two or more sources in the Sources tab, the property names in the Filters tab also include the source name. For instance, the property [CsContactBasic] Full Name has [CsContactBasic] as the source and Full Name as the property.
  • Select the columns to display: You can select the columns you want to display from the sources you have selected and the order in which you want the columns to appear. When you define two or more sources in the Sources tab, the property names in the Display tab also include the source name. For instance, the property [CsContactBasic] Full Name has [CsContactBasic] as the source and Full Name as the property.
  • Define the sorting order of the columns: You can order and prioritize the properties in each column in ascending, descending, or random order. When you define two or more sources in the Sources tab, the property names in the Sorts tab also include the source name. For instance, the property [CsContactBasic] Full Name has [CsContactBasic] as the source and Full Name as the property.
  • Test the query: It is important to test the query and edit it, if necessary, to make sure the desired results are returned.
  • Save the query to an appropriate folder: To save a valid query, you must select at least one source and one column. If you select more than one source, the relationship between the sources must be defined. In most cases, a default relationship is inherited from your other sources.
  • Create a group that automatically refreshes: You can create a group where an automated task can refresh the query to determine the members of the group by the query results.
  • Modify security access to the query: You can modify the security on a filter to assign read, write, and run privileges.

Tips for building queries

  • Review Best practices for writing IQA queries for information about how to keep queries from causing performance issues for your website.
  • Review information on Business Object Designer to help select the appropriate objects for your query.
  • Base the structure and location for your query file/folder on the needs and access levels of your users.
  • Start with a single source object and add additional objects as needed.
  • Some attributes (relations, default columns, default column order) are inherited from the sources you select. You can modify these default settings during query definition/editing.
  • Do not put slashes (/) in IQA names. Doing so will cause errors when importing. To avoid these errors, update all existing IQA queries with slashes in their name and update any content items or reports associated with the queries.
  • When loading a query page, you may encounter different messages indicating the duration it took for the page to load and a link to the IQA queries: Best Practices article. The messages might include the following:

    • If it takes between two and three seconds for the query to run, you will see the following yellow message:
    • If it takes between two and three seconds for the query to run, you will see the following yellow message:

IQA tab options

The following options are available during each step of the query creation process:

Creating or editing queries

Follow the steps at Building a new query to create or edit a query.