[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-31。"],[],[],null,["# Tutorial: Create a Google Sheets data source\n\nA data source provides the data for a Looker Studio report. In this lesson, you'll create a data source that connects to one of your own Google Sheets.\n\nStep 0: Prepare your data\n-------------------------\n\nComplete the following sections to make working with your Sheets data in Looker Studio easier:\n\n### Use a separate worksheet for Looker Studio data\n\nSpreadsheets let you store and analyze your data in a flexible format that might be difficult to model in Looker Studio. We recommend creating a separate worksheet for the data you want to see in Looker Studio.\n| **Tip:** You can automate getting data from one worksheet into another using Google Sheets functions. For example:\n|\n| \u003cbr /\u003e\n|\n| `='Worksheet 1'!A1` --- copies the contents of cell A1 in Worksheet 1.\n|\n| \u003cbr /\u003e\n|\n| Sheets provides others ways of fetching data from one cell or range of cells into another, including:\n|\n| - [VLOOKUP](https://support.google.com//docs/answer/3093318)\n| - [HLOOKUP](https://support.google.com//docs/answer/3093281)\n| - [QUERY](https://support.google.com//docs/answer/3093331)\n\n### Table format\n\n- The worksheet or range you connect to should have a simple tabular format. Each column should contain only single cells: merged cells may cause your data to appear incorrectly.\n- Cells should only contain data: you can't import graphs or images, for example.\n- The first row of the worksheet provides the field names in your data source.\n\n### Date format\n\n- Dates in your Google Sheet should contain the full day, month, and year. For example, 9/22/2020 or 2020-09-22.\n\n- If you have time data, it should be combined with the date field. For example, 9/22/2020 11:55:30.\n\n- Date fields should be formatted as dates (using the **Format \\\u003e Number \\\u003e Date** menu option in Sheets).\n\nOther ways of handling dates are possible, but may require more work on your part.\n\n[Learn more about handling dates and times in Looker Studio](/looker/docs/studio/dates-and-times).\n\n### Data structure\n\nOrganizing your data in certain ways can make it easier to work with in Looker Studio. For example:\n\n**Long is better than wide.** Limit the number of dimensions by grouping data into categories, rather than having columns for each possible value. For example, if you are measuring sales of fruit from a grocery store, doing this:\n\n*Long table example*\n\n...is better than this:\n\n*Wide table example*\n\nIn the long table example, your data source only requires one dimension for the Fruit category, whereas the wide table example requires one dimension for each type of fruit. If you sold 100 varieties of fruit, you'd need 100 dimensions to measure them all using the second example. This would be impossible to display in a Looker Studio chart.\n\nGrouping your data series into dimensions also makes [filtering](/looker/docs/studio/about-filter-properties) in Looker Studio easier. For example, in the long table example, it's easy to build a filter on Fruit = \"Apples.\" In the wide table example, you can't filter by type of fruit.\n\n**Understand your aggregations.** If your Sheet includes aggregated data, such as sums, averages, medians, etc., be careful not to mix that data with unaggregated data in Looker Studio charts. If you do, the numbers in those charts might not be correct. For example, let's say the wide table above included a Totals row:\n\n*Wide table with totals*\n\nScorecards in Looker Studio would display inflated numbers for each of the fruit dimensions (because it adds the totals to the un-aggregated metrics):\n\n*Scorecard examples*\n\nIn this case, it's best to not include the totals row in the data source and instead, let Looker Studio calculate the totals.\n\nStep 1: Connect to Google Sheets\n--------------------------------\n\nThe first step in creating a data source is to connect to your [dataset](/looker/docs/studio/dataset).\n\n1. [Sign in to Looker Studio.](https://lookerstudio.google.com)\n2. On the Looker Studio home page, in the top left, click **Create** , and then select **Data Source**.\n3. In the *connectors panel* , select **Google Sheets.**\n4. Select a **Spreadsheet** and **Worksheet.**\n5. Optionally, uncheck **Use first row as headers**. The fields in your data source will instead use the default Sheets column labels: \"A,\" \"B,\" \"C,\" etc.\n6. Optionally, uncheck **Include hidden and filtered cells.** These will now be excluded from the data source\n7. Optionally, specify a **range of cells**. Otherwise, the entire worksheet is used.\n8. Click **CONNECT** in the upper right. The *fields* *panel* appears.\n\nStep 2: Configure the data source\n---------------------------------\n\nThe data source configuration page contains all the dimensions (the green chips) and metrics (the blue chips) from the data set. You can fine-tune the data source by renaming or disabling fields, adding calculated fields, and changing the aggregation and data type.\n\nLearn more about [modeling your data](/looker/docs/studio/model-your-data).\n\n### Add a metric\n\nYou can add a [metric](/looker/docs/studio/metric) to the data source by clicking next to a dimension and selecting one of the available functions. You'll need at least one metric to chart your data in Looker Studio.\n\nStep 3: Rename your data source\n-------------------------------\n\nLooker Studio automatically names your data source the same as your dataset name. If you want to change that, click the name in the upper left and enter a new name.\n\nYou can also rename the data source later from the DATA SOURCES home page by clicking the context menu and selecting **Rename**.\n\nStep 4: Share the data source\n-----------------------------\n\nYou can let other editors add this data source to reports by sharing it with them.\n\n### To share a data source\n\n1. In the upper right, click **Share**.\n\n2. Enter the email addresses or Google Groups that you want to share with.\n\n3. For each person or group, select the access (permissions). Permissions determine what other people can do with the data source. Your choices are as follows:\n\n - **Can view**. People with this permission can view but not edit the data source.\n\n - **Can edit**. People with this permission can both view and edit the data source.\n\nStep 5: Use this data source in reports\n---------------------------------------\n\nYou can now create reports that get their data from your Google Sheet:\n\n1. Click **CREATE REPORT** in the upper right\n2. You'll see the report editor tool, and a table appears with fields from that data source.\n 1. Use the properties panel on the right to change the data and style.\n3. In the top left, name your report by clicking *Untitled Report*.\n\nRelated resources\n-----------------\n\n- [Google Sheets connector](/looker/docs/studio/connect-to-google-sheets)\n- [Report tutorials](/looker/docs/studio/tutorial-report-intro)\n- [Share a data source](/looker/docs/studio/ways-to-share-your-reports)\n- [Copy a data source](/looker/docs/studio/copy-a-data-source)\n- [Calculated fields](/looker/docs/studio/about-calculated-fields)\n- [Data source credentials](/looker/docs/studio/data-credentials)"]]