Doing Basic Maths on Numeric Fields via Calculated Fields
Note: Google Data Studio is now known as Looker Studio.
Follow the steps below to do basic maths on numeric fields via calculated fields:
Step-1: Consider the following data source named ‘Sales- ABC Inc’:
This is the data source, we are going to use.
Step-2: Navigate to Looker Studio and then click on the ‘Create’ button:
Step-3: Click on ‘Data Source’:
Step-4: Click on the ‘Google Sheets’ connector as we are going to use Google Sheets document as our data source:
Step-5: Find and click on your Google sheets document:
Step-6: Click on the ‘Connect’ button on the top right-hand side to connect your data source to data source schema:
The data source schema for this data source would look like the one below:
Step-7: Correct the data types of various fields by changing them from their corresponding drop-down menus:
Step-8: Click on the ‘Add a field’ button:
Step-9: Name the new calculated field: Ecommerce Conversion rate:
Step-10: Hover your mouse over the ‘Total Transactions’ field:
Step-11: Click on the ‘+’ button next to it:
Once you clicked on the + button, the ‘Total Transactions’ field would appear in the formula box:
Step-12: Press the spacebar key on your keyboard to give one white space.
Step-13: Type forward slash ‘/’ from your keyboard and then give another white space by pressing the spacebar key:
Step-14: Hover your mouse over the ‘Total Website Sessions’ field and then click on the ‘+’ button next to it:
The final formula to calculate the ecommerce conversion rate is going to look like the one below:
Here we are using the arithmetic operator ‘division’ denoted by a forward slash / between the two numeric fields: ‘Total Transactions’ and ‘Total Website Sessions’.
Step-15: Click on the ‘Save’ button at the bottom right-hand side to save the new calculated field:
Step-16: Click on the ‘All Fields’ button in order to navigate back to the data source schema editor:
You should now be able to see the new calculated field called ‘Ecommerce Conversion rate’ in the data source schema:
Step-17: Click on the ‘Add a field’ button to create a new calculated field called ‘Product Revenue’ and then enter the following formula:
Here we are using the arithmetic operator ‘multiplication’ denoted by * between the two numeric fields: ‘Quantity’ and ‘Average Price’.
Step-18: Click on the ‘Save’ button and then navigate back to the data source schema editor by clicking on the ‘All Fields’ button.
Step-19: Create a new calculated field called ‘Revenue’ and then enter the following formula:
Here we are using the arithmetic operator ‘addition’ denoted by + among the following numeric fields: ‘Product Revenue’, ‘Tax’ and ‘Shipping Cost’.
Step-20: Click on the ‘Save’ button and then navigate back to the data source schema editor by clicking on the ‘All Fields’ button.
Step-21: Create a new calculated field called ‘Gross Profit’ and then enter the following formula:
Here we are using the arithmetic operator ‘subtraction’ denoted by – among the following numeric fields: ‘Product Revenue’, ‘Tax’ and ‘Shipping Cost’.
Step-22: Click on the ‘Save’ button and then navigate back to the data source schema editor by clicking on the ‘All Fields’ button.
You should now be able to see all the new calculated fields you have created so far:
Step-23: Change the data type of the calculated field ‘Ecommerce Conversion Rate’ to ‘Percent’:
Step-24: Change the data type of the calculated fields: ‘Gross Profit’, ‘Product Revenue’ and ‘Revenue’ to ‘Currency (USD – US Dollar ($))’:
Step-25: Click on the ‘Create Report’ button:
Step-26: Click on the ‘Add to Report’ button:
Your new report may look like the one below:
Step-27: Add the following fields to this table:
- Total Transactions
- Total Website Sessions
- Quantity
- Average Price
- Tax
- Shipping Cost
You can add these fields by dragging them one by one from the ‘Available Fields’ section to the ‘Dimensions’ section in the property panel:
Once you have dragged and dropped all the required fields from the ‘Available Fields’ section to the ‘Dimensions’ section, your property panel may look like the one below:
Step-28: Resize your data table:
Step-29: Remove the ‘Record Count’ field from the data table by hovering your mouse over the ‘Record Count‘ metric in the property panel and then clicking on the cross button next to the metric:
Your data table would now look like the one below:
Step-30: Click on the ‘Style’ tab in the property panel:
Step-31: Click on the ‘Header font color’ drop-down menu (under the ‘Table Header’):
Step-32: Set the color to white:
Step-33: Click on the Header background color drop-down menu (under ‘Table Colors’):
Step-34: Set the color to red:
Your data table would now look like the one below:
Step-35: Right-click on the table and then select ‘Duplicate’ to create a copy of the table:
Once you clicked on the ‘Duplicate’ button you are going to see a copy of the table:
Step-36: Re-arrange this new table so that it appears right below the old table. You can do that by dragging it down:
Step-37: Select the second data table and then remove the following fields from it: ‘Total Transactions’, ‘Total Website Sessions’, ‘Quantity’, ‘Average Price’, ‘Tax’ and ‘Shipping Cost’.
You can remove these fields one by one by hovering your mouse over the relevant dimension and then clicking on the cross button next to it:
Once all the specified dimensions are removed, your report would look like the one below:
Step-38: Add the following dimensions to the second data table: ‘Ecommerce Conversion Rate’, ‘Product Revenue’, ‘Revenue’ and ‘Gross Profit’.
You can add these dimensions one by one by dragging them from the ‘Available Fields’ column and then dropping them in the ‘Dimensions’ section in the property panel:
Your report would now look like the one below:
Step-39: Re-size the second data table like the one below:
Step-40: Change the header color of the second table to blue so that it looks different from the table above:
That’s how you can do basic maths with numeric fields via the calculated fields.
Other articles on Looker Studio
- Looker Studio Alternative – Whatagraph
- Looker Studio Parameters explained with examples
- Looker Studio Number Formats / Data Types
- How to Change Language in Looker Studio
- Looker Studio Date Format and Time Explained
- Looker Studio Tutorial with FREE PDF ebook
- Looker Studio Functions, Formulas Tutorial
- How to work with the Boolean field in Looker Studio
- Looker Studio Page Navigation Tutorial
- Understanding Report Editor in Looker Studio
- Best practices for creating a report in Looker Studio
- How to share reports in Looker Studio
- Seven methods to create a new report in Looker Studio
- Looker Studio Report Tutorial
- How to invite people to view or edit a report in Looker Studio
- How to share the link of your report in Looker Studio
- Schedule email delivery of a report in Looker Studio
- How to download Looker Studio report as PDF
- How to embed a Looker Studio report on a website
- Guide to Data Types in Looker Studio
- Image function in Looker Studio
- Image Link data type in Looker Studio
- Image data type in Looker Studio
- Looker Studio Geo Map – Latitude Longitude
- Why You Should Avoid Using Functions and Calculated Fields in Looker Studio
- Looker Studio Calculated Fields Tutorial
- Working with the Text data type in Looker Studio
- The Data Set Configuration Error in Looker Studio
- Data Source Fields in Looker Studio – Tutorial
- Refresh data source schema fields in Looker Studio
- Looker Studio Data Sources – Tutorial
- Looker Studio Dimension vs Metric
- How to filter by email in Looker Studio
- Looker Studio – Sharing Data Sources (aka data source schema)
- Field editing in reports – Looker Studio
- Data Source Version History in Looker Studio
- Community Visualization Access in Looker Studio
- Understanding Data Source Credentials in Looker Studio
- Understanding Data Freshness in Looker Studio
- How to create and configure a data source in Looker Studio
- Looker Studio Aggregation Explained
- How to Edit a Calculated Field in Looker Studio
- Formula Rejection in Looker Studio
Note: Google Data Studio is now known as Looker Studio.
Follow the steps below to do basic maths on numeric fields via calculated fields:
Step-1: Consider the following data source named ‘Sales- ABC Inc’:
This is the data source, we are going to use.
Step-2: Navigate to Looker Studio and then click on the ‘Create’ button:
Step-3: Click on ‘Data Source’:
Step-4: Click on the ‘Google Sheets’ connector as we are going to use Google Sheets document as our data source:
Step-5: Find and click on your Google sheets document:
Step-6: Click on the ‘Connect’ button on the top right-hand side to connect your data source to data source schema:
The data source schema for this data source would look like the one below:
Step-7: Correct the data types of various fields by changing them from their corresponding drop-down menus:
Step-8: Click on the ‘Add a field’ button:
Step-9: Name the new calculated field: Ecommerce Conversion rate:
Step-10: Hover your mouse over the ‘Total Transactions’ field:
Step-11: Click on the ‘+’ button next to it:
Once you clicked on the + button, the ‘Total Transactions’ field would appear in the formula box:
Step-12: Press the spacebar key on your keyboard to give one white space.
Step-13: Type forward slash ‘/’ from your keyboard and then give another white space by pressing the spacebar key:
Step-14: Hover your mouse over the ‘Total Website Sessions’ field and then click on the ‘+’ button next to it:
The final formula to calculate the ecommerce conversion rate is going to look like the one below:
Here we are using the arithmetic operator ‘division’ denoted by a forward slash / between the two numeric fields: ‘Total Transactions’ and ‘Total Website Sessions’.
Step-15: Click on the ‘Save’ button at the bottom right-hand side to save the new calculated field:
Step-16: Click on the ‘All Fields’ button in order to navigate back to the data source schema editor:
You should now be able to see the new calculated field called ‘Ecommerce Conversion rate’ in the data source schema:
Step-17: Click on the ‘Add a field’ button to create a new calculated field called ‘Product Revenue’ and then enter the following formula:
Here we are using the arithmetic operator ‘multiplication’ denoted by * between the two numeric fields: ‘Quantity’ and ‘Average Price’.
Step-18: Click on the ‘Save’ button and then navigate back to the data source schema editor by clicking on the ‘All Fields’ button.
Step-19: Create a new calculated field called ‘Revenue’ and then enter the following formula:
Here we are using the arithmetic operator ‘addition’ denoted by + among the following numeric fields: ‘Product Revenue’, ‘Tax’ and ‘Shipping Cost’.
Step-20: Click on the ‘Save’ button and then navigate back to the data source schema editor by clicking on the ‘All Fields’ button.
Step-21: Create a new calculated field called ‘Gross Profit’ and then enter the following formula:
Here we are using the arithmetic operator ‘subtraction’ denoted by – among the following numeric fields: ‘Product Revenue’, ‘Tax’ and ‘Shipping Cost’.
Step-22: Click on the ‘Save’ button and then navigate back to the data source schema editor by clicking on the ‘All Fields’ button.
You should now be able to see all the new calculated fields you have created so far:
Step-23: Change the data type of the calculated field ‘Ecommerce Conversion Rate’ to ‘Percent’:
Step-24: Change the data type of the calculated fields: ‘Gross Profit’, ‘Product Revenue’ and ‘Revenue’ to ‘Currency (USD – US Dollar ($))’:
Step-25: Click on the ‘Create Report’ button:
Step-26: Click on the ‘Add to Report’ button:
Your new report may look like the one below:
Step-27: Add the following fields to this table:
- Total Transactions
- Total Website Sessions
- Quantity
- Average Price
- Tax
- Shipping Cost
You can add these fields by dragging them one by one from the ‘Available Fields’ section to the ‘Dimensions’ section in the property panel:
Once you have dragged and dropped all the required fields from the ‘Available Fields’ section to the ‘Dimensions’ section, your property panel may look like the one below:
Step-28: Resize your data table:
Step-29: Remove the ‘Record Count’ field from the data table by hovering your mouse over the ‘Record Count‘ metric in the property panel and then clicking on the cross button next to the metric:
Your data table would now look like the one below:
Step-30: Click on the ‘Style’ tab in the property panel:
Step-31: Click on the ‘Header font color’ drop-down menu (under the ‘Table Header’):
Step-32: Set the color to white:
Step-33: Click on the Header background color drop-down menu (under ‘Table Colors’):
Step-34: Set the color to red:
Your data table would now look like the one below:
Step-35: Right-click on the table and then select ‘Duplicate’ to create a copy of the table:
Once you clicked on the ‘Duplicate’ button you are going to see a copy of the table:
Step-36: Re-arrange this new table so that it appears right below the old table. You can do that by dragging it down:
Step-37: Select the second data table and then remove the following fields from it: ‘Total Transactions’, ‘Total Website Sessions’, ‘Quantity’, ‘Average Price’, ‘Tax’ and ‘Shipping Cost’.
You can remove these fields one by one by hovering your mouse over the relevant dimension and then clicking on the cross button next to it:
Once all the specified dimensions are removed, your report would look like the one below:
Step-38: Add the following dimensions to the second data table: ‘Ecommerce Conversion Rate’, ‘Product Revenue’, ‘Revenue’ and ‘Gross Profit’.
You can add these dimensions one by one by dragging them from the ‘Available Fields’ column and then dropping them in the ‘Dimensions’ section in the property panel:
Your report would now look like the one below:
Step-39: Re-size the second data table like the one below:
Step-40: Change the header color of the second table to blue so that it looks different from the table above:
That’s how you can do basic maths with numeric fields via the calculated fields.
Other articles on Looker Studio
- Looker Studio Alternative – Whatagraph
- Looker Studio Parameters explained with examples
- Looker Studio Number Formats / Data Types
- How to Change Language in Looker Studio
- Looker Studio Date Format and Time Explained
- Looker Studio Tutorial with FREE PDF ebook
- Looker Studio Functions, Formulas Tutorial
- How to work with the Boolean field in Looker Studio
- Looker Studio Page Navigation Tutorial
- Understanding Report Editor in Looker Studio
- Best practices for creating a report in Looker Studio
- How to share reports in Looker Studio
- Seven methods to create a new report in Looker Studio
- Looker Studio Report Tutorial
- How to invite people to view or edit a report in Looker Studio
- How to share the link of your report in Looker Studio
- Schedule email delivery of a report in Looker Studio
- How to download Looker Studio report as PDF
- How to embed a Looker Studio report on a website
- Guide to Data Types in Looker Studio
- Image function in Looker Studio
- Image Link data type in Looker Studio
- Image data type in Looker Studio
- Looker Studio Geo Map – Latitude Longitude
- Why You Should Avoid Using Functions and Calculated Fields in Looker Studio
- Looker Studio Calculated Fields Tutorial
- Working with the Text data type in Looker Studio
- The Data Set Configuration Error in Looker Studio
- Data Source Fields in Looker Studio – Tutorial
- Refresh data source schema fields in Looker Studio
- Looker Studio Data Sources – Tutorial
- Looker Studio Dimension vs Metric
- How to filter by email in Looker Studio
- Looker Studio – Sharing Data Sources (aka data source schema)
- Field editing in reports – Looker Studio
- Data Source Version History in Looker Studio
- Community Visualization Access in Looker Studio
- Understanding Data Source Credentials in Looker Studio
- Understanding Data Freshness in Looker Studio
- How to create and configure a data source in Looker Studio
- Looker Studio Aggregation Explained
- How to Edit a Calculated Field in Looker Studio
- Formula Rejection in Looker Studio
My best selling books on Digital Analytics and Conversion Optimization
Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.
Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.
Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.
Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.