Setting and running the model SQL query

In the query editor, provide a SQL query to identify the subset of data to obtain from the source database. The query must be deterministic - it must return the same data every time it runs.

You can use the table and column list on the Source tab at the left as a reference. If you uploaded CSV files, then each file becomes a table, with the file name (minus the extension) as the table name. For example, you upload a file named my_model_data.csv. This becomes a table named my_model_data.

If the model contains event data, then make sure that the query results include a numeric column that can be used to sort the data based on a datetime value. You might need to transform a datetime column to use a numeric format.

To run the query, either click Run Query or press Shift-Enter. The query results are used to populate the table below the query editor and the Schema list on the model details view.

Last updated