[[["易于理解","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-08-25。"],[],[],null,["# Create, rename, copy, hide, and remove fields\n\nOnce you've created a data source, you can add, remove, and change the fields.\n| **Tip:** To apply changes that were made in the underlying dataset to the data source, see [Refresh data source fields](/looker/docs/studio/refresh-data-source-fields).\n\nCreate a new field\n------------------\n\nYou can create new fields in a data source in two ways:\n\n- Create a new count or count distinct metric from an existing dimension.\n- Use [calculated fields](/looker/docs/studio/about-calculated-fields) to create more complex metrics or new dimensions.\n\n### Create count and count distinct metrics\n\nTo count values in a dimension, follow these steps:\n\n1. [Edit the data source](/looker/docs/studio/edit-a-data-source).\n2. Next to field you want to count, click **More**.\n3. Click **Count** or **Count distinct**.\n\nThe new field is added to the field list and is named \"Count (or Count Distinct) of \\[original field name\\].\" If the data source has a lot of fields, you might have to scroll to see the new field.\n\n#### Example: Count the number of sales representatives per sales region\n\nSuppose you have a spreadsheet that tracks sales people and the regions they cover:\n\nA Google Sheets data source based on this data would look like this:\n\nTo find out how many sales people you have in each region, you can create a new metric to count them by following these steps:\n\n1. Next to **Employee ID** , click **More**.\n2. Select **Count Distinct** from the menu.\n\nThis creates a new metric, **Count Distinct Employee ID**. (You can change this name by clicking the new field.) The new metric can be used in visualizations just as you would any other field.\n\nTo edit the formula, at the end of the metric field, click **fx.**\n\nRename a field\n--------------\n\nTo rename a field, follow these steps:\n\n1. [Edit the data source](/looker/docs/studio/edit-a-data-source)..\n2. Click the name of the field you want to change.\n3. Enter a new name.\n\n### Effects of renaming a field\n\nWhen you rename a data source field, the new name is used in the following places:\n\n- Calculated fields that use this field (renaming a field won't break calculated fields)\n- The *Available Fields* panel in reports\n- Charts that use this field\n - **Exception**: if you've renamed this field in a chart, the chart continues to use the name you gave it there. (The field name in the chart overrides the field name in the data source.)\n\nCopy a field\n------------\n\nTo create a copy of a field, follow these steps:\n\n1. [Edit the data source](/looker/docs/studio/edit-a-data-source).\n2. Next to the field that you want to copy, click **More**.\n3. Click **Duplicate**.\n\nHide a field\n------------\n\nHiding a field disables it. To hide a field, follow these steps:\n\n1. [Edit the data source](/looker/docs/studio/edit-a-data-source).\n2. Next to the field that you want to hide, click **More**.\n3. Click **Hide** . To unhide the field, follow the same steps and then click **Show**.\n\n### Effects of hiding a field\n\nHiding a data source field has the following effects:\n\n- The field appears grayed out in the data source field list.\n- The field won't appear in the **Properties** panel in reports.\n- The field won't appear in report metadata or data requests.\n- Charts, filters and calculated fields that use this field display an error.\n\n| **Tip:** To fix errors in charts, calculated fields, filters, or other components, remove the hidden field from the broken component.\n\nRemove a field\n--------------\n\nRemoving a field deletes if from the data source. To remove a field, follow these steps:\n\n1. [Edit the data source](/looker/docs/studio/edit-a-data-source).\n2. Next to the field that you want to remove, click **More**.\n3. Click **Remove**.\n\n### Effects of removing a field\n\n| **Important:** Removing a calculated field permanently deletes the field. Once a field is removed, you can't get the calculated field back except by recreating it.\n\nRemoving a data source field has the following effects:\n\n- The field is removed from the data source field list.\n- The field is removed from the **Properties** panel in reports.\n- The field won't appear in report metadata or data requests.\n- Charts, filters and calculated fields that use this field display an error.\n\n| **Tip:** To fix errors in charts, calculated fields, filters, or other components, remove the deleted field from the broken component.\n\nRestore a removed field\n-----------------------\n\nTo add removed fields back to the data source [reconnect the data source](/looker/docs/studio/edit-the-data-source-connection) or [refresh the data source fields](/looker/docs/studio/refresh-data-source-fields).\n\nRelated resources\n-----------------\n\n- [Model your data](/looker/docs/studio/model-your-data)\n- [About calculated fields](/looker/docs/studio/about-calculated-fields)"]]