Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tutorial 11: Connecting to External Data

Similar presentations


Presentation on theme: "Tutorial 11: Connecting to External Data"— Presentation transcript:

1 Tutorial 11: Connecting to External Data

2 Objectives Import data from a text file
Work with connections and external data ranges Define a trusted location Understand databases and queries Use the Query Wizard to import data from several tables Edit a query © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

3 Objectives Import tables from Access for use with a PivotTable
Manage relationships involving multiple tables Create a Web query Retrieve financial data using the WEBSERVICE function Access data from an XML document Work with XML data maps © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

4 Visual Overview: Retrieving Text Data
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

5 Visual Overview: Retrieving Text Data
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

6 Exploring External Data Sources
Data that is stored in locations other than the Excel workbook are known as data sources Data source files can be stored in a variety of formats, for example: Historical data, long-term trends (text files) Current trend information (databases) Up-to-the-minute data (the Internet) © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

7 Exploring External Data Sources
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

8 Importing Data from Text Files
Simple, widely used format for storing raw, unformatted data (text and numbers) Useful for sharing data across software programs and computer systems Understanding Text File Formats Use a delimiter (space, comma, or tab) to separate columns of data Use fixed-width text file to start each column at the same location © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

9 Importing Data from Text Files
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

10 Importing Data from Text Files
Starting the Text Import Wizard Determines if data is fixed-width or delimited format and, if delimited, what delimiter is used Steps of Text Import Wizard On the DATA tab, click From Text in the Get External Data group In the Import Text File dialog box, select the file and click Import; the Text Import Wizard – Step 1 of 3 opens © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

11 Importing Data from Text Files
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

12 Importing Data from Text Files
Specifying the Starting Row Can specify the file type: Delimited – characters separate each field Fixed-width – fields are aligned in columns with spaces between each field Can specify starting row other than first row Indicate it data has headers Click Next button to go to Text Import Wizard – Step 2 of 3 © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

13 Importing Data from Text Files
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

14 Importing Data from Text Files
Editing Column Breaks Text Import Wizard needs to know where each column begins and ends The point at which one column ends and another begins is the column break Delimited format: delimiter determines column breaks Fixed-width format: wizard guesses locations of column breaks © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

15 Importing Data from Text Files
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

16 Importing Data from Text Files
Formatting and Trimming Incoming Data In Step 3 of 3, format the data in each column General format is applied by default To specify a format: Select a column in the Data preview box Click the appropriate option button in the Column Data format section Indicate if a column should not be imported © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

17 Importing Data from Text Files
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

18 Importing Data from Text Files
Click Finish to import the selected data Data can then be used to create a chart © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

19 Exploring External Data Ranges and Connections
When data is imported into a worksheet, it is stored within an external data range Each external data range is given a defined name based on the data source filename Assigned name can be edited Excel can update (refresh) data ranges and connections manually or automatically Importing data creates a connection between the workbook and the text file © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

20 Exploring External Data Ranges and Connections
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

21 Exploring External Data Ranges and Connections
Excel supports other properties for external data ranges, which include: Keep the contents of the external data range current by reimporting or refreshing the data Require the user to enter a password before data is refreshed Define whether the refreshed external data range retains or replaces the formatting and layout Define whether Excel inserts or overwrites cells when new rows are added to the data range © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

22 Exploring External Data Ranges and Connections
Viewing a Data Connection A data connection is like a pipeline from a data source to one or more locations in the workbook The same data connection can link multiple data ranges, PivotTables, or PivotCharts When you import external content Excel establishes a connection between a data range and that data source © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

23 Exploring External Data Ranges and Connections
Viewing a Data Connection (con’t.) To see where a data connection is being used, you can view that connection’s properties © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

24 Exploring External Data Ranges and Connections
Modifying Data Connection Properties You can modify data connection properties © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

25 Defining a Trusted Location
Once a trusted location is defined, Excel will access the connection to the data source without prompting for confirmation that the connection is secure © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

26 Visual Overview: Excel Databases and Queries
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

27 Visual Overview: Excel Databases and Queries
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

28 An Introduction to Databases
A database is a structured collection of data Databases are commonly used as the data sources for Excel workbooks A database is divided into separate tables Each table is arranged in columns and rows; also referred to as fields and records A field stores information about a specific characteristic of a person, place, or thing A record is a collection of fields © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

29 An Introduction to Databases
Excel can retrieve data directly from most database programs © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

30 An Introduction to Databases
Different tables are connected through database relationships; fields common to each table are used to match records in different table A one-to-one relationship is one in which one record in a table is matched to exactly one record from a second table A one-to-many relationship is one in which one record is matched to one or more records in a second table Relational databases are ones in which tables can be joined through the use of common fields © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

31 An Introduction to Databases
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

32 Retrieving Data with Microsoft Query
Create a query to extract specific information from a database A query contains a set of criteria that specify what values to retrieve and in what order Queries are written in a language called SQL or Structured Query Language Microsoft Query uses a wizard containing a collection of dialog boxes that guide you through the entire query process © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

33 Retrieving Data with Microsoft Query
To start Microsoft Query Wizard: Click the From Other Sources button in the Get External Data group on the DATA tab Click From Microsoft Query © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

34 Retrieving Data with Microsoft Query
Connecting to a Data Source There are several types of data sources from which you can retrieve data You can define your own data source by clicking <New Data Source> in the list of databases Once connected to the data source, the Query Wizard – Choose Columns dialog box opens © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

35 Retrieving Data with Microsoft Query
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

36 Retrieving Data with Microsoft Query
Choosing Tables and Fields Choose table and fields to include in the query © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

37 Retrieving Data with Microsoft Query
Filtering and Sorting Data Determine whether to retrieve all records or to filter data to retrieve only records that satisfy particular criteria © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

38 Retrieving Data with Microsoft Query
Filtering and Sorting Data (con’t) Specify how to sort the data by values in fields © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

39 Retrieving Data with Microsoft Query
The Query Wizard – Finish dialog box provides three options: Return (import) the data into the Excel workbook Display the results of the query in Microsoft Query Save the query to a file © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

40 Retrieving Data with Microsoft Query
Editing a Query Add new columns to a worksheet Change the sort order options Revise any filters Edit a query by editing the definition of the connection; Query Wizard will restart Modify the query definition as you walk through the steps of the wizard © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

41 Importing Data from Multiple Tables into a PivotTable
Import multiple tables from a database directly into Excel without using Microsoft Query If tables are related through a common field, Excel will automatically include the relationship The entire table will be imported because the query is not defined © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

42 Importing Data from Multiple Tables into a PivotTable
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

43 Importing Data from Multiple Table Into a PivotTable
To import a table: Click the From Access button in the Get External Data group on the DATA tab Select from the Select Data Source dialog box © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

44 Importing Data from Multiple Table Into a PivotTable
Set up and format the PivotTable and slicer © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

45 Exploring the Data Model and PowerPivot
The data model is a database built into Excel that provides database tools Data model database contents are immediately available to PivotTables, PivotCharts, and other Excel features The data model is constructed from different tables related by common fields Installing the PowerPivot Add-In Interact with the data model using PowerPivot – an add-in for Excel 2013 that provides tools for performing advanced data analysis and modeling © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

46 Exploring the Data Model and PowerPivot
Installing the PowerPivot Add-In (con’t) With PowerPivot, you can: Apply filters to tables stored in the data model Rename tables and fields within the data model Define and manage the relationships among data tables joined by common fields Format data values that will be used in PivotTables and other Excel reports Create calculated fields based on data fields from multiple data sources Create advanced data structures and models © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

47 Exploring the Data Model and PowerPivot
Adding a Table to the Data Model The POWERPIVOT tab contains the commands from working with the data model Use the Add to Data Model command to add Excel tables to the data model PowerPivot displays the contents of the data model in a separate window from the Excel workbook window © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

48 Exploring the Data Model and PowerPivot
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

49 Exploring the Data Model and PowerPivot
Viewing the Data Model View the contents of a data model in Data view and in Diagram view Data view shows the contents of each database table in the data model on a separate tab Diagram view shows each table as an icon and relationships between tables are indicated by connecting arrows To see which field joins two tables, click the arrow connecting the tables © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

50 Exploring the Data Model and PowerPivot
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

51 Exploring the Data Model and PowerPivot
Managing Relationships in the Data Model To match records of one table to that of other tables, create a relationship between tables When creating a relationship, identify a field in each table that will be used to match records © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

52 Visual Overview: Web and XML Connections
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

53 Visual Overview: Web and XML Connections
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

54 Creating a Web Query To keep an Excel workbook in sync with data store on a website, create a query that retrieves data from a webpage To create this web query, you need the URL of the page you are accessing If the file is stored on a web server, it follows the format: If the file is stored locally, it follows the format: file:///drive:/path/filename © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

55 Creating a Web Query To open the New Web Query dialog box, click the From Web button in the Get External Data group on the DATA tab © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

56 Creating a Web Query Formatting a Web Query
Can format text imported from the web query Formatting is preserved when Excel refreshes data Can also retrieve the webpage data and the styles None imports text, not formatting Rich Text Format (RTF) allows for text formatting styles but not advanced features Full HTML retrieves all simple as well as advanced HTML formatting features © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

57 Creating a Web Query © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

58 Creating a Web Query Saving a Web Query
Can save a web query to a permanent file that you share among other Office documents The saved connection file can be loaded in any Office program © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

59 Retrieving Live Stock Quotes from the Internet
Excel can be used with websites that provide stock market data Yahoo Finance is free Excel can retrieve data from these kinds of web services uses the following function: WEBSERVICE(url) © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

60 Retrieving Live Stock Quotes from the Internet
Stock values retrieved through the WEBSERVICE function do not act like web queries and are not treated as data connections. They are not refreshed automatically when the workbook is reopened. © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

61 Retrieving Live Stock Quotes from the Internet
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

62 Retrieving Live Stock Quotes from the Internet
To enter the ticker symbols and column titles © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

63 Retrieving Live Stock Quotes from the Internet
To enter the WEBSERVICE function © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

64 Retrieving Live Stock Quotes from the Internet
The current stock quotes for all of the stocks listed in the Chalcedony Fund © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

65 Retrieving Data Using Office Apps
Excel can be used with Office apps, which are small, specialized programs that enhance the features of Excel, Word, PowerPoint, and other programs in the Office suite Office apps can retrieve articles from online encyclopedias, insert maps, and retrieve timely stock quotes and financial information © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

66 Retrieving Data Using Office Apps
Inserting and Office App Apps are downloaded from the Microsoft Office Store; most apps are free To download and use Office apps, you need an account with Microsoft Office; the account is free, requiring only a username and password to set up © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

67 Importing Data from XML
XML is a language used to create structured documents using only text Office files are saved in an XML format called the Office Open XML © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

68 Importing Data from XML
Each piece of data in an XMP document is contained within an element Data is marked by an opening and closing tag XML documents are structured like a tree in which elements are placed within one another, descending from a common root element The structure of the document is displayed in a data map © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

69 Importing Data from XML
Under this structure, the root element, document, contains six elements named title, subtitle, date, author, filename, and notes. © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

70 Importing Data from XML
XML author can create rules specifying: Which elements are required What types of values are allowed within each element Rules are stored in a second document called the schema Not required in XML Are useful in ensuring the integrity and validity of XML data © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

71 Importing Data from XML
Editing an XML File Before importing data, you can edit it The first step in connecting a workbook to an XML document is to generate the data map After Excel has generated a data map, you can use it to place XML content anywhere within the workbook © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

72 Importing Data from XML
Generating an XML Data Map © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

73 Importing Data from XML
Loading an XML Data Map Commands to access the data map of an XML document are part of Excel Developer tools To work with an XML data map, you must show the DEVELOPER tab on the ribbon If the XML document has a schema file attached to it, you can load a data map without actually importing the data into the Excel workbook © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

74 Importing Data from XML
Binding XML Elements to a Worksheet Using XML as a data source, allows you to attach (bind) elements to specific cells in the workbook © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

75 Importing Data from XML
Importing XML Data You can import XML data directly into worksheet cells To retrieve XML data, refresh the connection to the data source Excel automatically places data in the correct worksheet cells Can automatically update XML data in a workbook to reflect changes to the source XML document © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

76 Importing Data from XML
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

77 Using Real-Time Data Acquisition
Another data source: real-time data acquisition values from measuring devices and scientific equipment Usually requires purchase of an add-in to manage communication between Excel and the measuring device Excel provides the RTD function to facilitate real-time data acquisition Can save hours of data entry time © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.


Download ppt "Tutorial 11: Connecting to External Data"

Similar presentations


Ads by Google