Using Microsoft Excel
In Microsoft Excel, you can connect to Spark data by using one of the following tools:
- Data Connection Wizard: Use this wizard to retrieve a table from Spark. When using this wizard, you can only retrieve a single table at a time, and you cannot filter the result set. For more information, see Using the Data Connection Wizard.
- Query Wizard: Use this wizard from Microsoft Query to define and run a simple query. You can query multiple tables and columns, and sort and filter the result set. For more information, see Using the Query Wizard.
- Microsoft Query: Work directly in the application to define and run complex queries. For example, you can define parameterized queries and different types of joins. For more information, see Using Microsoft Query.
The following procedures are written for Microsoft Excel 2013. The Simba Spark ODBC Driver also supports Excel 2010.
Important:
Make sure that the bitness of the driver that you are using matches the bitness of Excel. If you are using the 32-bit version of Excel, then you need to use the 32-bit version of the driver. If you are using the 64-bit version of Excel, then you need to use the 64-bit version of the driver. For more information about diagnosing the issue, see "Architecture Mismatch Problems" in Troubleshooting.
Using the Data Connection Wizard
To connect using the Data Connection Wizard:
- In Excel, select the Data tab in the ribbon, then click From Other Sources in the Get External Data group, and then click From Data Connection Wizard.
- In the Data Connection Wizard, select ODBC DSN in the list of data source types, and then click Next.
- In the list of ODBC data sources, select your DSN, and then click Next.
- From the list of tables, select the name of a table that you want to retrieve, and then click Finish.
- In the Import Data dialog box, in the Existing Worksheet field, specify the cell where you want the top left corner of the selected table to be inserted, and then click OK.
Data from the selected table is displayed in the current Excel worksheet.
Using the Query Wizard
Note:
The Query Wizard is part of Microsoft Query. When the Query Wizard is open, you can switch from using the Query Wizard to working directly in Microsoft Query at any time by clicking Cancel and then clicking Yes at the prompt.
To connect using the Query Wizard:
- In Excel, select the Data tab in the ribbon, then click From Other Sources in the Get External Data group, and then click From Microsoft Query.
- In the Choose Data Source dialog box, on the Databases tab, select your DSN.
- Make sure that the Use the Query Wizard to Create/Edit Queries check box is selected, and then click OK.
- In the Query Wizard, select the tables or columns that you want to include in your query by selecting each item in the left pane and then clicking the > button. When your selection is complete, click Next.
- To filter the data in your query, select a column from the left pane, then select a comparison operator from the list, and then specify a value in the list on the right. Repeat as needed to define additional filters, and then click Next to proceed.
- To sort the data in your query, select the column on which you want to base the sorting and then specify whether to sort the data in ascending or descending order. Repeat as needed to define additional levels of sorting, and then click Next to proceed.
- Optionally, to save the query so that you can run it again without going through the process of recreating it, click Save Query, type a unique name for the query, and then click Save.
- Select Return Data To Microsoft Excel and then click Finish.
- In the Import Data dialog box, in the Existing Worksheet field, specify the cell where you want the first column header of the result set to appear, and then click OK.
Note:
If the tables or columns that you want to include are not listed in the left pane, then click Options and configure the table options as needed.
Data retrieved from the defined query is displayed in the current Excel spreadsheet.
Using Microsoft Query
To connect by working directly in Microsoft Query:
- In Excel, select the Data tab in the ribbon, then click From Other Sources in the Get External Data group, and then click From Microsoft Query.
- In the Choose Data Source dialog box, on the Databases tab, select your DSN.
- Clear the Use the Query Wizard to Create/Edit Queries check box, and then click OK.
- In the Add Tables dialog box, select the tables that you want to include in your query by selecting each table and then clicking Add. When your selection is complete, click Close. If necessary, you can reopen the dialog box to add more tables by clicking Add Table(s)
.
- To define joins between your tables, in the upper pane, click and drag a field from one table to a field in another table. You can then double-click the line between the fields to modify the join.
- Select the columns that you want to include in your query by double-clicking the column names from the tables. You can double-click the asterisk (*) to select all the columns from a table.
- To filter the data in your query, click Show/Hide Criteria
and then use the options in the criteria pane to define your filters.
- To sort the data in your query, select a column header in the lower pane and then click Sort Ascending
or Sort Descending
as needed.
- If Auto Query
is disabled, then click Query Now
to run your query and see the results.
- When you are finished defining your query, click Return Data
to retrieve the result set in Excel.
- In the Import Data dialog box, in the Existing Worksheet field, specify the cell where you want the first column header of the result set to appear, and then click OK.
Note:
If the tables that you want to include are not listed in the dialog box, then click Options and configure the table options as needed.
Note:
For detailed information about defining joins in Microsoft Query, see the "Creating, Changing, and Removing Joins" section in the Microsoft Query Help documentation that is provided in the application.
Note:
If Auto Query is enabled, then the results of your query automatically appear in the lower pane. Otherwise, you must click Query Now
to run the query and see the results.
Data retrieved from the defined query appears in the current Excel spreadsheet.
Note:
For more information about defining complex queries using Microsoft Query, see the Microsoft Query Help documentation that is provided in the application.