Creating a custom SQL query
gives you the ability to flexibly present the data in a table in any way you wish using SQL features like calculated columns, aggregation, formatting, filtering, joins and lookups. To create a custom SQL query, you must be logged on to your LabKey Server as an Admin or you must have both the Trusted Analyst
and Editor roles. The following steps guide you through creating a custom SQL query and view on a data table.
Create a Custom SQL Query
- Select (Admin) > Developer Links > Schema Browser.
- From the schema list, select the schema that includes your data tables of interest.
- Click the Create New Query button.
- In the field What do you want to call the new query?, enter a name for your new query.
- In the drop-down field Which query/table do you want this new query to be based on?, select the base query/table for your query.
- Click Create and Edit Source.
- LabKey Server will generate an SQL query for the selected table.
- Refine the source of this query as desired in the SQL source editor.