Creating a Query
This page explains how to create new queries in xAssets. There are several ways to create a query, depending on whether you want to start from scratch or clone an existing one.
Prerequisites
You must have Configuration or Administrator user group permissions to create queries.
Methods for Creating a Query
1. Create a New Empty Query
Click the
button in the query list, or choose New Query from the Query Editor menu above the list.
This creates a blank query. You must specify the subject, type, and then add columns.
2. Clone from the Query List
Select an existing query in the list and click the
button, or choose Clone Query from the Query Editor menu.
3. Clone from Within the Query Editor
Open an existing query and click the
button in the editor toolbar.
4. Clone from the Find Dialog
When finding a query (e.g., by clicking
without a selected query), click the
button in the Find dialog.
Tip: Cloning copies both the query definition (columns, filters, variants) and its report layout. This is the fastest way to create a new query -- find a similar existing query, clone it, then adjust the columns and filters. Most queries in xAssets were built by cloning and modifying an existing one.
Steps to Create a Query from Scratch
- Navigate to Admin > Queries > Queries and Reports.
- Click New Query.
- Enter a Query Name that clearly describes what the query shows (e.g., "Assets by Location with Warranty Status").
- Select the Subject -- this determines which database table the query operates on and which columns are available (e.g., Assets, Custodians, Contracts).
- Select the Type -- this categorises the query's purpose (e.g., Standard, Filter, Search). Some types display an information alert explaining their use.
- Optionally set a Context to associate the query with specific Query Header/Footer menus.
- Switch to the Query Columns tab and use Insert Columns to add columns from the list of available fields.
- Configure column display properties (width, display type, formatting) as needed.
- Add filter conditions to restrict the results.
- Save the query.
- Run the query to verify it returns the expected results.
Steps to Create a Query by Cloning
- Find an existing query that is similar to what you need.
- Clone it using one of the methods above.
- Change the Query Name to describe the new query.
- Adjust the columns -- add, remove, or reorder as needed.
- Modify the filter conditions.
- Save and test.
After Creating a Query
After creating a query, you may want to:
- Add it to a menu item so users can run it from the navigation menu. See Menus.
- Create variants for different filtered views. See Query Variants.
- Configure the presentation hierarchy for drilldown and charts. See Query Columns and Display.
- Customise the report layout for PDF export. See Query Sorting and Report Design.
Related Articles
- Editing a Query — the query editor fields and tabs
- Query Columns and Display — configuring columns
- Query Record Filters — adding filter conditions
- Query Variants — creating multiple views from one query