Visual Query conditions

You can constrain a search according to the properties and metadata of records by adding conditions to the Visual Query. You can add conditions to any of the items in a query structure.

A query condition is made up of a property or metadata type, an operator, and one or more values. The number of values depends on the operator that you choose.

By adding query conditions, you can look for records with specific values or ranges of values in their properties; and you can also involve metadata such as record identifiers or date of upload. You can narrow the focus of the search by gradually adding more conditions, increasing the complexity of the query. For example:
  • If your query structure consists of a single Person type, you can narrow the focus to search for all people with the given name "John" and family name "Doe".
  • By adding query conditions to more than one query item, you can find people called John Doe who own a car with a license plate that starts "ABC".
  • By adding a count condition to a query item, and then entering a value of 2 for the condition, you can find people who own at least two cars.
  • By adding a condition that limits results to records with notes that contain a particular string, you can identify records that might be more relevant to your analysis.
  • By specifying characteristics that are described by a link between two accounts, you can search for accounts that are involved in high-value transactions. For example, your condition might require transactions of value greater than $75,000.
When you add conditions to query items, there are several things to consider:
  • How to create conditions
  • Aspects of date and time types
  • Use of wildcards
  • Multiple values in a single condition
  • How multiple conditions are combined

Creating conditions

When you create a condition, you start by selecting its property or metadata type. After you select the type, several operators are available to use. (For example, 'Between', 'Is exactly', 'Is not', 'Contains', 'Matches wildcard pattern'.) Be aware that the 'Between' operator is inclusive (it includes the values that you enter), and that not all operators are available for all types - for example, record identifiers support only the "Is exactly" and "Is not" operators. For more about the mechanics of creating conditions, see Adding conditions to a Visual Query.

Every condition that you add to a query item is added to a group that determines how multiple conditions are combined together. By default, records that match your query must meet all the conditions that you add, but you can change that rule so that meeting any condition is enough, or add subgroups that enforce different rules. See Combining conditions for more information.

Date and time types

For types that store date, time, or date and time values, you can create conditions such as "Date of Birth equal to 15 Mar 1966", or "Date first uploaded later than 01 Jan 2018". However, you can also add conditions that use aspects of such values, which allow you to search for transactions that were made on any Monday, or dates of birth that are 1 Jan in any year.

When you create a date and time condition, you must choose an aspect to use. For example, Date of Birth might appear in the Add Condition window several times with different aspects: Date of Birth » Date, Date of Birth » Day of Week, Date of Birth » Month.

If you specify a time as part of a condition, you can choose how to deal with time zones. The choice that you make affects the search that takes place. When you select a time zone, all times are converted to that zone for comparison, so a time of 1pm GMT matches 8am EST. If you decide to ignore time zones, times are compared literally, so that a time of 1pm GMT matches 1pm EST, as well as 1pm in any other time zone.

Wildcards

For types that store text values, the 'Matches wildcard pattern' operator is available to be used in conditions. The following wildcards are supported:

?
Matches a single unknown character. For example, J?n matches "Jan" and "Jon" but not "Jean".
*
Matches zero or more unknown characters. For example, J*n matches "Jn", "Jan", "Jon", and "Jean".

Multiple values

For a condition that uses a text value, you can select 'Is exactly' or 'Is not' as the operator and then provide several possible values by entering them on separate lines. Each line in the value of a condition is treated as a single value, including any spaces and wildcards.

If a text file contains the values that you want to use, you can import values from the file. Any file that you use must have the file type .txt and contain row-separated values.

Combining conditions

Note:
If you're using Visual Query with an i2 Analyze server at version 4.4.3 or earlier, then the functionality around combining conditions is different from the description below. Refer to the documentation here instead.

When a single query item has several conditions, the rules that govern how those conditions are combined are set by the groups that the conditions are in. For each query item in your structure, you can create top-level groups and subgroups that contain nested conditions, with "meets any" and "meets all" options. This arrangement gives you the flexibility to create complex queries when you need them.

  • Different items in the query structure can have different combination rules. For example, consider a simple structure that has a Person query entity linked to a Vehicle query entity. You might specify that all of these conditions must be met:
    • On the Person entity, Family Name is exactly Steel.
    • On the Person entity, First (Given) Name is exactly Ben.

    And that at least one of these conditions must be met:

    • On the Vehicle entity, Vehicle Color is exactly Black.
    • On the Vehicle entity, Vehicle Color is exactly Blue.
    The query results then contain people with the family name "Steel", AND the first name "Ben". Ben Steel is linked to a vehicle that is "Black" OR "Blue" in color.
  • For any particular item in the query structure, you can group conditions involving any property or metadata type together, and then decide if all or at least one of the conditions must be met.

    For example, your information might not specify the exact spelling of the Family Name for the Person entity in your query. You're looking for Ben Steel, but you want to ensure your search picks up variations. You can set Family Name is exactly Steele, OR Family Name is exactly Steel, OR Family Name is exactly Steal. The records in the search results must meet at least one of those conditions.

  • If you specify multiple values for a single condition, the combination rules depend on the operator. For 'Is exactly', any one of the values must match the data. For 'Is not', none of the values must match the data.