Manually Edit a Prediction Query

Applies to: SQL Server 2019 and earlier Analysis Services Azure Analysis Services Fabric/Power BI Premium

Important

Data mining was deprecated in SQL Server 2017 Analysis Services and now discontinued in SQL Server 2022 Analysis Services. Documentation is not updated for deprecated and discontinued features. To learn more, see Analysis Services backward compatibility.

After you have designed a query by using the Prediction Query Builder, you can modify the query by switching to Query Text view on the Mining Model Prediction tab of Data Mining Designer. A text editor appears at the bottom of the screen to display the query that the query builder created.

Switching to Query Text view is useful for making additions to the query. For example, you can add a WHERE clause or ORDER BY clause.

Use the grid in the Prediction Query Builder to insert the names of objects and columns and set up the syntax for individual prediction functions, and then switch to manual editing mode to change parameter values.

Note

If you switch back to Design view from Query Text view, any changes that you made in Query Text view will be lost.

Modify a query

  1. On the Mining Model Prediction tab in Data Mining Designer in SQL Server Data Tools, click SQL.

    The grid at the bottom of the screen is replaced by a text editor that contains the query. You can type changes to the query in this editor.

  2. To run the query, on the Mining Model menu, select Result, or click the button to switch to query results.

    Note

    If the query that you have created is invalid, the Results window does not display an error and does not display any results. Click the Design button, or select Design or Query from the Mining Model menu to correct the problem and run the query again.

See Also

Data Mining Queries
Prediction Query Builder (Data Mining)
Lesson 6: Creating and Working with Predictions (Basic Data Mining Tutorial)