﻿ Doing Basic Maths on Numeric Fields via Calculated Fields - Optimize Smart

# Doing Basic Maths on Numeric Fields via Calculated Fields

My step-by-step blueprint for using Looker Studio (formerly Google Data Studio)

### Get the FREE ebook on Looker Studio (75 Pages)

Last Updated: December 11, 2022

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-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:

1. Total Transactions
2. Total Website Sessions
3. Quantity
4. Average Price
5. Tax
6. 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-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-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.

## "How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."

Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

​#7 How to learn and master digital analytics and conversion optimization in record time.

## 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 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.

### Himanshu Sharma

• Founder, OptimizeSmart.com
• Over 15 years of experience in digital analytics and marketing
• Author of four best-selling books on digital analytics and conversion optimization
• Nominated for Digital Analytics Association Awards for Excellence
• Runs one of the most popular blogs in the world on digital analytics