Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
8 views

Pivot Table Tutorial

Uploaded by

armeen.ahmed24
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Pivot Table Tutorial

Uploaded by

armeen.ahmed24
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Revenue analysis for an online store using

PivotTables – An EXCEL study guide

IBA – ITC – ICA Course


Table of Contents
1. Introduction ................................................................................................................................ 2
2. Questions .................................................................................................................................... 2
3. Dataset ........................................................................................................................................ 3
4. Goal ............................................................................................................................................. 4
5. Step by Step guide – PivotTable Analysis in EXCEL ..................................................................... 5
5.1. Create PivotTables – Foundation ......................................................................................... 5
5.2. Grouping by country ............................................................................................................ 7
a. Average Order Value (AOV) – Country-wise ..................................................................... 11
5.3 Order by City ....................................................................................................................... 12
a. Average Order Value (AOV) – City-wise ............................................................................ 13
5.4 Order by new vs returning customers ................................................................................ 14
a. Average Order Value (AOV) by Country & Customer type ............................................... 16
5.5 Order of revenue by year & month .................................................................................... 16
a. Revenue by Year................................................................................................................ 16
b. Revenue by Month/Year ................................................................................................... 18
c. Graphical representation .................................................................................................. 25
6. References ................................................................................................................................ 26
7. Glossary ..................................................................................................................................... 27

PivotTable. BI Case Study. Part I ITC / ICA P a g e |1


1. Introduction

2. Questions
Common questions by businesses looking to increase sales are given below. Analysis carried out
to answers them is also mentioned:

❖ Question # 1: Which countries have the highest Average Order Value (AOV)?
❖ Analysis: Aggregating data and calculating AOV for each country identifies countries with
higher sales and helps target marketing efforts to them to maximize revenue.

❖ Question: Which cities have the highest Average Order Value (AOV)?
❖ Analysis: Summarizing data and calculating AOV for each city identifies cities with higher
revenues and focuses advertising and promotions to them to increase sales.

❖ Question: Do new or returning customers have a higher Average Order Value (AOV)?
❖ Analysis: Segregating data into new and returning customers and calculating AOV for each
group helps explain which customer type spends more. This allows for tailored marketing
strategies to retain existing customers and attract new ones.

❖ Question: What is the revenue trend throughout the year, and how does it relate to the
Average Order Value (AOV)?

PivotTable. BI Case Study. Part I ITC / ICA P a g e |2


❖ Analysis: A monthly analysis of revenue data reveals revenue patterns over the year.
Variation in patterns, i.e., seasonality helps in planning targeted marketing campaigns
during periods of higher AOV to boost sales.

We use PivotTables to analyze the data on different dimensions - country, city, customer type,
and months to provide valuable insights into customer behavior and revenue patterns. Data-
driven decisions are used to optimize sales strategies, improve customer experience, and
ultimately increase sales.

3. Dataset
The dataset represents 11 years’ worth of online sales and includes the following columns:

❖ Serial: A unique identifier for each record in the dataset in ascending order.
❖ Txn_ID: A unique identifier to track and reference individual transactions.
❖ Revenue: Sales amount generated from each transaction.
❖ Country: Country where the order was placed.
❖ City: City where the order was placed.
❖ Year: Transaction year.
❖ Month: The month when the transaction was made.
❖ User_Type: Categorization of users into New Visitors and Returning Visitors.
❖ Device: The device used by the user to make a transaction - desktop, mobile or tablet.
❖ Source: The channel from which the user was acquired or reached the platform, e.g.,
organic search, direct search, referral.
❖ DaysToTxn: Number of days from the user's initial engagement with the site to sale.

Figure 1 shows a sample of the dataset. The full dataset is given on the tab “Master” in the
EXCEL worksheet “IBA-ITC-Raw-Dataset-FTC”.

PivotTable. BI Case Study. Part I ITC / ICA P a g e |3


Figure 1 – Extract of the dataset

4. Goal
The purpose is to convert the data to PivotTables, conditionally formatted tables, and graphs
to discern patterns and enable analysis.

Figure 2 - Transformation of the dataset – PivotTables

PivotTable. BI Case Study. Part I ITC / ICA P a g e |4


Figure 3 - Transformation of the dataset – Conditional Formatting and Graphs

5. Step by Step guide – PivotTable Analysis in EXCEL

5.1. Create PivotTables – Foundation


The PivotTable function in EXCEL summarizes the data by selected fields. The data can be
aggregated in various cuts based on selected filters and value types.

To create a PivotTable go to the “Master” tab in the EXCEL worksheet. Select all the columns
and rows of the dataset. Click on the Insert tab in the main menu ribbon of the worksheet.

Figure 4 - Go to Insert in the menu ribbon of EXCEL

PivotTable. BI Case Study. Part I ITC / ICA P a g e |5


From the Insert section, select the PivotTable option.

Figure 5 – Click on PivotTable

In the pop-up screen select the “Select a table or range” radio button. The selected data range
will appear in the input field “Table/Range:”. Choose the “New worksheet” radio button option
and click OK to create the PivotTable in a new tab.

Figure 6 – Create PivotTable pop-up showing the data source and output options

PivotTable. BI Case Study. Part I ITC / ICA P a g e |6


A new tab will be inserted with an empty PivotTable and Field List generated as follows:

Figure 7 – Empty PivotTable and Field list

The field list contains the selected column names (or fields) from the dataset with check boxes
against them. Desired fields, based on the analysis to be performed, are dragged to one of four
areas - Filters, Columns, Rows or Values - to populate the PivotTable.

❖ Rows & columns – group the data by distinct categories in the selected fields
❖ Values – summarize the data from a selected field by a value type (such as sum or count
or average, etc.)
❖ Filters – allow for viewing subsets of the data or excluding certain data.

Various options and selections help in analyzing the data in different ways. Some variations are
discussed below.

5.2. Grouping by country

Our first PivotTable answers the questions:

❖ “Which top seven revenue-generating countries should sales effort be focused on?”
❖ “Which countries have a disproportionate share of sales, given their population, size, and
economic footprint?”

What fields do we need for the analysis? Country, year, revenue, and device (for order count).

Select and drag the “Country” field to the Rows area, “Revenue” and “Device” to the Values
area, and “Year” and “Revenue” to the Filters area of the PivotTable Fields list. No field is
entered in the Columns area. Columns in the PivotTable, therefore, will show the aggregated
Values area fields.

PivotTable. BI Case Study. Part I ITC / ICA P a g e |7


Figure 8 - Selecting fields to populate the PivotTable

Revenue and device fields are added in the Values area. Specifically, we need the sum of
revenue and the number or count of devices (representing the number of orders) here. Click
the drop-down arrow against the field in the Values area, and select the Value Field Settings
option.

PivotTable. BI Case Study. Part I ITC / ICA P a g e |8


Figure 9 – Value field settings

A pop-up screen will appear:

Figure 10 – Value Field Setting popup screen-summarization options

Choose how to summarize the data from the selected field by the type of calculation. You may
also choose to show the data other than as is. For example, the Sum of Revenue may be
expressed as a percentage of the total, a difference, a rank value, or index.

Figure 11 – Value Field Setting popup screen-summarization options

PivotTable. BI Case Study. Part I ITC / ICA P a g e |9


Click OK to confirm your selection. Filters enable us to work with a subset of the data. Or to
exclude data we do not want. For example, we include “Revenue” in Filters to exclude null
values as they distort/ dampen the result. Select the dropdown against the Revenue field filter
and uncheck the checkbox against the null value.

Figure 12 - Filtering revenue and removing null values

Our focus is the top seven revenue-generating countries. To order the display, click on the
dropdown button next to the column “Row Labels”. In the input field “Sort by” choose “Sum of
Revenue” and sort by Descending. Click OK.

Figure 13 – Ordering by Sum of Revenue

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 10


The countries are now displayed from largest to smallest by Sum of Revenue.

a. Average Order Value (AOV) – Country-wise


Calculate the AOV of the top 7 revenue-generating countries, by first copying and pasting the
first seven rows as a new table. Add a column and calculate AOV as the Sum of Revenue
(renamed Value) divided by the Count of Device (renamed Orders). This gives the average
revenue per order for the country. Copy the formula to all the rows.

Figure 14 - Calculating AOV

Finally, to format the PivotTable and the copy-pasted table extract go to the Number
formatting section in the Home tab of the main menu ribbon. Click on the separator (comma)
and decimal formatting buttons as required.

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 11


Figure 15 - Sorting by country. AOV to top 7 countries by Sum & Count (value & % of Total). Formatted.

5.3 Order by City


Populate the PivotTable as follows:

❖ Rows: City
❖ Columns: [None]
❖ Values: Revenue (Sum), Serial (Count)
❖ Filters: Year, Revenue

Figure 16 - Choosing fields for a city-wise PivotTable

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 12


Deselect the null value revenue cells to exclude them. Order the table by revenue from the
highest to lowest generating city by clicking the dropdown of the Row Labels and selecting
“Descending” under Sort and “Sum of Revenue” for Sort by.

Figure 17 - Sorting by Revenue – city-wise analysis

The resulting table is ordered in descending order by Sum of Revenue with the highest revenue
generating cities appearing at the top of the table.

a. Average Order Value (AOV) – City-wise


Copy and paste the top 8 rows to create another table. Add a column for AOV calculated as
revenue divided by orders.

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 13


Figure 18 - Calculating AOV on extracted rows from PivotTable

Format the data for separator and decimal places.

5.4 Order by new vs returning customers


Next, we segment country-wise revenue by new and returning customers to assess which group
of customers to focus our marketing efforts on.

A variation of the PivotTable analysis by country, the table fields are the same (with Serial
instead of Devices used for the count of orders) with one exception. “User-Type” is added to
the Columns area of the PivotTable field list. Specifically, the fields are:

❖ Rows: County
❖ Columns: User_Type
❖ Values: Revenue (Sum), Serial (Count)
❖ Filters: Year (All), Revenue (exclude null or blank values)

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 14


Figure 19 – Fields selected for displaying country wise orders by new vs returning customers

Adding User_Type to the Columns area, segregates Revenue and Orders by New and Returning
Visitor. Total Sum of Revenue and Count of Serial columns show the totals across all customers.

We order the table by highest to lowest revenue-generating countries to run additional analysis
on the top N countries.

Figure 20 – Extract from the PivotTable of the top revenue-generating countries segmented for new and returning customers

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 15


a. Average Order Value (AOV) by Country & Customer type
Calculate AOV and proportion of orders for each customer group to see which customer group
contributes more in terms of value and number of sales.

AOV = revenues/number of orders.

Percentage share of returning customers = Number of orders by returning customers divided by


the number of orders across all customers.

Percentage share of new customers = Number of orders by new customers divided by the
number of orders across all customers.

Figure 21 - Calculating AOV and proportion of orders by country and customer segment

For example, returning customers from India have a higher proportion of orders and AOV
compared to new customers. For Saudi Arabia, new customers have a larger AOV.

5.5 Order of revenue by year & month


Time analysis by year and month highlights seasonal trends and worst-performing months. It
may also help predict revenue for future months.

a. Revenue by Year
The fields used are as follows:
❖ Rows: Year
❖ Columns: [None]
❖ Values: Revenue (Sum)
❖ Filter: Month (All)

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 16


Figure 22 - Fields for calculating Revenue by Year

Copy and paste this data to a separate table. To see a visual representation of this year-wise
data select the table. Go to the Insert tab and select the line graph chart to analyze trends over
time.

Figure 23 - Inserting a line graph

Use Formatting options to add features to the graph. For example, right clicking on the line and
selecting “Add Data Labels” will show the yearly revenue values at each point on the graph.

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 17


Figure 24 - Graphing the revenue by year data

The graph shows that 2021 had the highest sales revenue. Since then, sales have declined.

b. Revenue by Month/Year
Next, we analyze the data by month as well as year.

The fields used are as follows:


❖ Rows: Year
❖ Columns: Month
❖ Values: Revenue (Sum)
❖ Filter: [None]

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 18


Figure 25 - Fields and PivotTable for Revenue by Month and Year

Copy and paste this table to another area in the EXCEL sheet.

i. Average Sales by Month

Use EXCEL’s AVERAGE() function to calculate the average monthly sales revenue for each
month across all years.

Figure 26 - Average sales revenue for the month of January

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 19


April has the highest average sales across the 11 years.

Figure 27 – Average Revenue by Month

ii. Year on Year Change in Monthly Revenue


Calculate year-on-year change in monthly revenue as revenue for a given month and year
divided by revenue for the same month of the previous year, minus 1.

Figure 28 – Year on year change in monthly revenue - formula

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 20


Figure 29 – Resulting Year on year monthly revenue change calculated table

Highlight trends in the data, for example good and bad performing months, by applying
conditional formatting.

Select the table values to format. Go to the Home tab. Select the dropdown in the Conditional
formatting section. Go to the Color Scale options. Select the Green-Yellow-Red color scale
option.

Figure 30 - Conditional Formatting – Color scales

A color gradient is applied to the cells with the maximum value cell green and minimum value
cell red. The gradient indicates where each value lies in the scale.

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 21


Figure 31 – Conditionally Formatted year on year change of monthly revenue

iii. Month on Month growth in revenue


Month on month change (growth/decline) in revenue is the revenue for a given month divided
by the revenue for the previous month minus 1.

Figure 32 - % month on month change in revenue

For February 2013, month on month change is revenue in February 2013 divided by revenue in
January 2013 -1. Copy and paste the formula to all cells in the table, except the cells in the
January column.

Given how the source table is constructed in EXCEL, the formula for January needs to be
different. The denominator should refer to the month of December of the previous year. Note
that December is the last column in the table, while the previous year is the immediately
preceding row. Hence the formula for the month of January is:

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 22


Figure 33 - % month on month change in revenue - January

Show changes as percentages by right clicking on the cells. Go to Format Cells, choose category
Percentage and set Decimal places to 0%.
.

Figure 34 – Formatting cells to Percentages

Finally, apply Conditional Formatting to the table.

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 23


Figure 35 – Month on month revenue growth table – Conditionally formatted

iv. Monthly revenue change over average monthly revenue


Determine the percentage change of a given month’s revenue to the average revenue for that
month across all years. If average revenue is a benchmark or target, this % difference gives the
variation from that target.

Figure 36 - making a new table

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 24


Figure 37 – Monthly revenue as a percentage of Average Revenue for the given Month

c. Graphical representation
To visualize the month/ year revenue, let us revisit the year on year change in Mmonthly
revenue table. Select the table. Go to the Insert tab. In the Charts sections click on waterfall
graph dropdown. Select 3-D surface.

Figure 38 – Making a 3D surface representation of Year on Year change in monthly revenue

Figure 39 – 3D surface chart for year on year change in monthly revenue

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 25


Apply the same process to generate the chart for the change in monthly revenue for a given
over the average monthly revenue across all years.

Figure 40 – 3D surface chart for change in monthly revenue for a given year to average monthly revenue across all years

6. References
❖ The I in BI… - Jawwad Ahmed Farid – May 2023, https://risktrainer.medium.com/the-i-
in-bi-7399af34113d#ad4f
❖ Sizing market – Jawwad Ahmed Farid – Mar 2023,
https://risktrainer.medium.com/sizing-markets-5582ef58484b
❖ Tracking Growth – Jawwad Ahmed Farid – Jun 2023,
https://risktrainer.medium.com/sizing-markets-5582ef58484b
❖ Better Excel Charts, Jawwad Ahmed Farid, 2016

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 26


7. Glossary
AOV - Average order value (AOV) measures the average customer spend per order. It is
calculated as total revenue divided by number of orders.

Data Analysis - Process of inspecting, cleaning, transforming, and modeling data to uncover
useful information, draw conclusions, and support decision-making.

Disproportionate - Out of proportion; unequal or imbalanced in relation to something else.

Economic Footprint - Impact of an individual, organization, or country on the economy in terms


of consumption, production, and overall economic activity.

Excel Template - A pre-designed spreadsheet in Microsoft Excel that can be used as a starting
point for various tasks or calculations.

Filter - A function used to selectively display specific data or elements based on certain criteria
or conditions.

Line Graph – A type of chart that displays data as points connected by straight lines, used to
show trends or changes over time.

PivotTable - A data summarization tool in Excel that allows users to arrange, analyze, and
summarize data from a larger dataset into a more manageable and organized format.

Power BI - A business analytics service by Microsoft that provides interactive data visualization
and business intelligence capabilities.

Predictions - Forecasts or estimates about future events, outcomes, or trends based on


historical data and analysis.

Revenue - The total income generated from sales of goods, services, or other sources within a
given period.

Seasonal Trends - recurring patterns in data that follow specific timeframes, typically repeating
on a yearly or seasonal basis.

Transaction - An exchange of goods, services, or financial assets between two or more parties.

Trend Lines - Lines on a graph that depict the general direction or pattern of data points, often
used to identify trends or patterns over time.

PivotTable. BI Case Study. Part I ITC / ICA P a g e | 27

You might also like