Skip to main content

Building an AQS query

This article describes how to build an AQS query using the full capabilities of the AQS Builder. As queries can range from simple to complicated, not every section may be relevant to the query you're building.

Configure the root node

The root node defines various properties of the query and produces an initial set of item results.

alt text

Set the query properties

  • AQS type - change to a different root node type:

    • AQS Query - fetches qualifying items of the selected design/interface and data from selected attributes.
    • AQS Join - as above, along with selected attributes from linked designs/interfaces.
    • AQS Statistics - calculates statistics for a single attribute on qualifying items.
  • Design or interface - items from this design/interface will be queried.

  • Collection - items from these collections will be queried. By default, only Live is selected.

Other properties vary depending on the selected AQS type. For a detailed look at each one, see Root node types.

Select attributes

To filter the data returned by the query, select the Attributes property. Use the Pathfinder to select the attributes you want to see data for.

For example, if you're querying the Street Lights design, you might want to see the Column Height, Installed Date and Location Description of qualifying items.

alt text

If the query is an AQS Join type, you can also select attributes on any design/interface linked to the current one (either directly or via multiple links).

For example, if querying the Jobs interface, you might want to see the Job Number, Description and Team Name of qualifying items. To select the Team Name attribute, you must follow the Teams Link attribute to the Teams design, and then select it there.

To see this example built step-by-step, see Example 4 - Parameters and Join.

alt text
Note

The more attributes you select, the more data is returned. Therefore, for optimal performance, only include attributes that are meaningful to your query.

Add child nodes

To filter the items fetched by your root node, select to add a child node onto the end of your query branch.

To see all child node types and what they do, see Child node types.

Comparison nodes

A comparison mode imposes a condition that must be true for queried items to qualify.

Comparison nodes require one or two inputs, so they appear as a pill shape containing segments.

alt text

Select a segment to fill it with another node. Typically, this will be a value (e.g. a number, a date, text) provided by you or derived from an attribute.

alt text

Functions

It's possible to fill a segment with a function that computes a value, such as an Add node.

alt text

Logical nodes

A logical node lets you chain multiple comparison nodes together. There are two types:

  • All - qualifying items must fulfil all the conditions after this node.

  • Any - qualifying items must fulfil at least one of the conditions after this node.

alt text

It's possible to add logical nodes after logical nodes, enabling you to build highly precise queries.

See screenshot
alt text

Edit child nodes

If you select an existing child node, you can:

  • Swap - change the selected node to another type. If any segments hold values, they'll remain but the node types offered will be limited.

  • Delete - remove the selected node from the query.

  • Link negated - enable this to invert the condition imposed by the node. Items must now fail the condition to be included in the query results. e.g. a Greater than node effectively becomes Not greater than.

How is this different from using the Less than node? Well, if you're using the node to compare an Attribute node, there's a subtle difference!

Using Link negated will also include items where the attribute holds no value at all. The Less than node won't!

alt text

Edit node segments

If you select a segment that's populated with a node, you can:

  • Open in Pathfinder - if the segment holds one of the following nodes, use the Pathfinder to change the selected attribute to another one:

  • Delete - remove the selected node from the segment.

alt text