Importing SQL Data to a New or Existing Model
To import data from an SQL database to new or existing models and datasets, you specify the source data and then specify how you want to import the data into model dimensions.
Prerequisites
- The SAPCP Cloud Connector and SAP Analytics Cloud agent are installed and configured.
- You have installed a JDBC driver. For details, see Import Data Connection to an SQL Database.
Procedure
-
Select the appropriate option:
-
If you're creating a new model:
- Select (Main Menu) Create Model.
- Select Get data from a data source.
- Select SQL Databases.
NoteFrom the acquire data panel, select the filter icon to narrow down the number of data sources in the list. You can filter by data source type or by category. -
If you're importing into an existing model:
- Select (Main Menu) Browse Files.
- Open the model you want to update.
- Switch to the Data Management screen.
- Select Data source.
- Select SQL Databases.
NoteYou can select the filter icon to narrow down the number of data sources in the list. You can filter by data source type or by category.
-
-
In the Import Data or Create
Model dialog, do the following:
- Choose a connection type.
- Choose an existing connection, or create a new connection.
- Select Copy a query from a model to copy and edit an existing query, or select Create a new query to create a new query.
-
To copy and edit an existing query, follow these steps:
- Select a query from the list, and select Next.
- Select Freehand SQL if you want to manually type an SQL statement, which adds a new card representing that query to the linking page.
- Make changes to the query.
-
Select Preview to review the data; if two or
more tables are joined, the Joined Table
Quality chart will show the number of accepted rows
from the first table as well as matched values, duplicated values,
and omitted values from other joined tables.
The values are displayed on the next page.
- Select Hide Preview.
-
Select View SQL to show the SQL query
generated for joined tables.
You can then select Save as Freehand SQL Query to create a freehand SQL query based on the content of the View SQL dialog.
NoteWhen creating a Freehand SQL query, if the query contains parameters that are shown with question marks, the Freehand SQL query cannot be edited. -
Select OK to save your changes.
You can continue to work on other tasks while the data is being uploaded in the background.
-
To create a new query, follow these steps:
- Select Next.
- Select Freehand SQL if you want to manually type an SQL statement, which adds a new card representing that query to the linking page.
-
Drag and drop one or more tables from the list, or search for
tables by name or description.
When you add tables with matching primary keys, a join is created.
-
If two or more tables are joined, you can select the (Inner Join) icon
to change the type of join to one of the following options:
- Intersecting data only (Inner Join) – This is the default option.
- All primary data (Left Outer Join)
- All data (Full Outer Join)
- Remove matched data (Exception) – This option removes rows from the left-hand side table that have a match in the right-hand side table.
-
Select Preview to review the data; if two or
more tables are joined, the Joined Table
Quality chart will show the number of accepted rows
from the first table as well as matched values, duplicated values,
and omitted values from other joined tables.
The values are displayed on the next page.
- Select Hide Preview.
-
Select View SQL to show the SQL query
generated for joined tables.
You can then select Save as Freehand SQL Query to create a freehand SQL query based on the content of the View SQL dialog.
NoteWhen creating a Freehand SQL query, if the query contains parameters that are shown with question marks, the Freehand SQL query cannot be edited. - Select Next to build your query.
-
Type a name and description for your query and select
Done.
You can continue to work on other tasks while the data is being uploaded in the background.
-
When the draft data is finished uploading, open it from the
Draft Data list (for a new model or dataset), or
the Draft Sources list (for an existing model or
dataset).
The data appears in the data integration view.
Next Steps
After the initial import of raw data, continue with the data preparation task before completing your model: Preparing Data.