Editing or Creating an Ad Hoc Report in Query Builder

Query Builder was built primarily for use in the Clarity theme; it might look less attractive in other UI themes, such as Classic.

  1. In the Business Intelligence (or Emissions Inventory) menu, click Query Builder.

  2. Click a link to edit an existing custom report, or click New.

  3. Only the author, and users granted appropriate permission, may edit or delete custom reports. If you do not have such permission and make any changes to a custom report, when you save you are prompted to enter a different report name. Alternatively, you can create a copy of the report with “Copy” at the end of the report name, as described in Using Existing Ad Hoc Reports.

    To export a report’s configuration as a JSON file, choose Actions»Export Report Configurations. Conversely, you can import a JSON file to create a report. An administrator can migrate reports from one environment to another; see Migrating Configurations. All reports will be created as new records.

  4. On the Build tab, define the data that will make up the report:

  5. If you have appropriate permissions, you may specify multiple sources to combine data. System performance will be affected if you make a large report that joins many sources.

    If you selected a subquery as your first source, when you click the vertical ellipsis you can choose to Combine with other subqueries. The subsequent dialog box allows you to select one of the following operations and a compatible subquery (has the same number of columns, with the same data type for each column, and the data types in the same order):

    Data may be hidden based on your role and security privileges.
    Numeric field values use the format specified in the Number Style system setting, with the following exceptions:
    - For aggregation types Average, Standard Deviation, Standard Deviation Population, Variance, Variance Population, Percent of Total (Count), Percent of Total (Sum), Sum, Minimum, and Maximum, the resulting values will have a maximum of six decimal places.
    - For Count and Count Distinct aggregations, the resulting values will be formatted as whole numbers.
    - If the report is exported to CSV or Excel, any aggregation values will be formatted as raw numbers.

    QB_build.png

     

    The calculation field is added to the report and appears in the Fields selection list. Calculation fields are treated the same as other fields in queries (e.g. as criterion, for selection in visualization, included in the dashboard, etc.). If a calculated field is edited or deleted, any filter (on the Filter tab) that uses the calculated field will be deleted automatically from the report.

    Calculation fields inherit the security configured for the fields used to create them. For example, a user will not be able to view data generated by a calculation field if the field was created using another field that is prohibited from the user.
    If a field is prohibited from a role, any calculated fields that are based on that field will not be available on the Filter tab. If a report has a calculated field that is based on a prohibited field, the value of the calculated field will be masked using the “XXXX” format.

    Options to limit negative performance issues:
    - When adding fields to the query, you are limited to 100 fields (including calculated fields).
    - You can adjust the number of seconds before a query times out in the “Query Time Out (in seconds)” system setting.
    - To limit the amount of data that is returned, choose Actions»Set row limit: enter a number in the Row Limit field and select either Rows or Percent. For example: if you set a row limit of 50% on a report that would normally return 200 rows, the report will return only the first or last 100 rows (depending on the ascending/descending Sorting criteria). If you select Include Ties and the last row returned has ties, those rows will also be included in the report. The row limit is applied after data is aggregated and grouped, and will be applied wherever the report is used (e.g. in Report Scheduler, Dashboard indicators, etc.). The Row Limit overrides the default Dashboard data point limit of 12.

    If you are creating a Distribution List of
    - employees: one of the columns must be Employee #
    - Cority users: one of the columns must be Login Name
    - email addresses: one of the columns must be Email Address.

    If you are creating a subquery for use in a custom measure:
    - the first column must be a number field (e.g. Amount)
    - the second column must be a date/time field
    - subsequent columns must be the GDDLOFB ID fields, in that order)
    Note that the Subquery field is not available on default custom measure layouts.

    Clicki_collapse.gif to collapse the Fields list to see more of your report.

  6. If necessary, adjust how the data is organized: 

  7. If you are defining a subquery for use in a LettersTemplate, you can limit the letter to only include data related to the record the letter is sent from. Filter on a field that ends in “ID”, then in the operator field beside it, select “Equals Main Record ID”. Note that no data will be shown on the Build tab because it must be generated from a record in the application.

  8. On the Visualize tab, define how the data will be presented:

  9. “Circular”, “Number Only” and “Map” types can be added to the Advanced Dashboard only.
    The “Injuries by Part of Body” report uses a “BodyMap” type that allows the data to be viewed as a heat map on this tab or in a dashboard indicator. For more information, see Monitoring Injuries by Part of Body on a Heat Map.

  10. On the More Settings tab define overall report parameters:

  11. For reports that were created prior to 2018.3, the Disable Site Security check box will be unselected. If a report is used as a subquery in another report, the data in each report will be filtered according to their respective Site Security settings.

    If you want to filter the subquery by a field value that is not in the main source entity on the Build tab, select the Filter Entity. Then on the Build tab add a filter (for an integer, number or string field type), select the “Is Filtered By” operator and select a field from the Filter Entity. A business rule configured to trigger on condition of this subquery will fire only for the configured field filter. (Note: The data preview on the Build tab will show the data unfiltered by this condition because the report won't be filtered by that condition until the business rule is triggered.)

  12. If you want to save the report template for future queries, click Save. Saved queries can be scheduled for recurring generation; see Scheduling Reports.

  13. Optionally, do one of the following: