By default, the definition of the fields in your reports matches how those fields are defined in the underlying data source. Specifically, fields in the report have the same name, data type, and aggregation as in the data source.
The Field Editing in Reports data source option allows report editors to change field definitions at the chart level. Editing field definitions in the report makes customizing your reports faster and easier. It reduces or even eliminates the need to duplicate fields in the data source in order to apply different aggregations or functions to the same data. It also allows you to have canonical field definitions in the data source, while tailoring the fields to fit different report requirements.In this article:
Enable/disable field editing in reports
You enable or disable field editing in reports at the data source level. New data sources have this option turned on by default. You must be able to edit the data source to change this.
To turn this off or on (for older data sources):
- Edit the data source(s) used in your report
- In the data source header, click Field Editing in Reports.
How editing fields in reports works
When you create a report based on a data source that has the Field Editing in Reports setting turned on, all the fields in the report that use the data source become editable. This option applies to all reports that use that data source. To edit a field definition in a report:
- Edit the report
- Select a chart
- In the chart's DATA properties panel, click the field's data type icon on the left-hand portion of the field.
Example of editable fields.
What you can edit
Editing a field lets you change the following :
- The field's name. For example, you can rename Order Value to Average Order Value.
- A metric's aggregation. For example, you can recalculate Order Value from Sum to Average.
- This option isn't available if the field is a metric with Auto aggregation type.
- The field's data type. For example, you can convert a Number to a Percent, or Text to a URL.
- A date field's granularity. For example, instead of grouping your data by full date (YYYYMMDD), you can group by year month (YYYYMM).
- A metric's comparison calculation. For example, you can apply a Percentage of Total function to your orders.
- A metric's running calculation. For example, you can show running sums of your data, record by record.
Learn more about comparison and running calculations.
Any changes you make to a given field only apply to that instance of the field in that chart. For example, if the Average Order field appears in a table and a bar chart in the same report, changing any of the attributes of that field in the table has no effect on the Average Order field in the bar chart.
Rename a fieldYou can change a field's display name in the selected chart. This lets you have multiple instances of the same field in a chart. For example, you can add 2 instances of the Order Value field to a table, and change the name of the second instance to Average Order Value. Use the aggregation options described below to change how the field is calculated.
Change the field aggregation
A field's aggregation determines how its data is calculated in the chart. You can select from the following aggregations:
- Count Distinct
- Standard deviation
Aggregation only applies to metric. Metrics with an aggregation of Auto can't be changed.
Change the field data type
A field's data type tells Data Studio what kind of data to expect as input. For example, Data Studio displays Text fields "as is," with no other processing. Even if the field contains numbers, Data Studio won't apply any numeric aggregation to it. A field defined as a URL, on the other hand, is displayed as hyperlinks.
When the specified data type and actual data don't match, unexpected results can occur. You can adjust a field's data type in circumstances when the data source hasn't been correctly configured and you don't have edit access to it. For example, converting a dimension containing valid data but defined as Text to a Date type can let you use it as date range dimension.
Change the date granularity
You can change how data in your charts is grouped by date by adjusting the Granularity of your date dimension. For example, if the date field contains the complete year, month, and day, you can group by year quarter (YYYYQ).
The tables below show the same data. The table on the right has the granularity set to YEAR QUARTER (YYYYQ). Notice how the data has been aggregated according to the new time unit: