Introduction

In the world of retail, making sure you are capitalizing on consumer demand is vital to maximizing sales and profits. Regork, a national grocery chain, has to deal with constant challenges and changing factors that they must face head on. To combat this, Regork must make sure they are providing the right amount of products to the right people at the right time. One factor that we believe Regork could take advantage of is seasonality. So the question we are addressing is,

Are there seasonal or holiday based spikes in product demand that we can capitalize on with targeting campaigns?

We believe this question is important to Regork because grocery chains become super important to consumers during certain holidays. The Regork CEO should be interested in this because they have the opportunity to maximize their profits and sales during the holidays by allocating the correct products, their resources, and marketing efforts in the most efficient and profitable way possible. They will need this type of information as there will be a consumer demand surge during the holidays.

We began by comparing holiday sales trends to non-holiday sales trends. We did this to allow us to identify any big differences in overall sales trends. We made a bar graph to visually show us these trends and help us identify any clear sales spikes during the holidays compared to normal times. Next, we wanted to see a daily sales trend over the course of a year to be able to identify where the big spikes are coming from. We made a graph that helped us visualize the daily sales from Regork from the start to the end of 2017. By doing this we were able to find out which holidays produce the biggest spikes and which holidays do not have as much effect on sales. Finally, we made a graph that was able to help us visualize the total sales from Regork by each month. Many companies do their inventory stocks and marketing campaigns based off which month they are in. This would help to show the company which months need the most inventory and most aggressive marketing campaigns.

Our three analysis points with graphs will help the Regork CEO by identifying the ways they can maximize their profits and sales. This will be done with the information we found on seasonal demand patterns and surges. Our proposed solution to the Regork CEO would be to prioritize holiday specific products and inventory as well as making their promotional campaigns more aggressive and holiday themed around the holidays.

Packages and Data Sets

library(completejourney)
library(lubridate)
library(ggplot2)
library(tidyverse)
library(dplyr)
transactions <- get_transactions()
transactions
## # A tibble: 1,469,307 × 11
##    household_id store_id basket_id   product_id quantity sales_value retail_disc
##    <chr>        <chr>    <chr>       <chr>         <dbl>       <dbl>       <dbl>
##  1 900          330      31198570044 1095275           1        0.5         0   
##  2 900          330      31198570047 9878513           1        0.99        0.1 
##  3 1228         406      31198655051 1041453           1        1.43        0.15
##  4 906          319      31198705046 1020156           1        1.5         0.29
##  5 906          319      31198705046 1053875           2        2.78        0.8 
##  6 906          319      31198705046 1060312           1        5.49        0.5 
##  7 906          319      31198705046 1075313           1        1.5         0.29
##  8 1058         381      31198676055 985893            1        1.88        0.21
##  9 1058         381      31198676055 988791            1        1.5         1.29
## 10 1058         381      31198676055 9297106           1        2.69        0   
## # ℹ 1,469,297 more rows
## # ℹ 4 more variables: coupon_disc <dbl>, coupon_match_disc <dbl>, week <int>,
## #   transaction_timestamp <dttm>
promotions <- get_promotions()
promotions
## # A tibble: 20,940,529 × 5
##    product_id store_id display_location mailer_location  week
##    <chr>      <chr>    <fct>            <fct>           <int>
##  1 1000050    316      9                0                   1
##  2 1000050    337      3                0                   1
##  3 1000050    441      5                0                   1
##  4 1000092    292      0                A                   1
##  5 1000092    293      0                A                   1
##  6 1000092    295      0                A                   1
##  7 1000092    298      0                A                   1
##  8 1000092    299      0                A                   1
##  9 1000092    304      0                A                   1
## 10 1000092    306      0                A                   1
## # ℹ 20,940,519 more rows
transactions$date <- as.Date(transactions$transaction_timestamp)

Exploratory Data Analysis

First we wanted to compare the average sales on holidays to the averages sales on any other day of the year. We also want to point out that our holiday data will be from the day before a major holiday. This is based on the assumption that there will be very little business on the day of the actual holiday and therefore we expect to see the days leading up to holidays to be much busier.

holiday <- as.Date(c("2016-12-31", "2017-07-03", "2017-11-22", "2017-12-23"))

transactions <- transactions %>%
  mutate(Day_Type = ifelse(date %in% holiday, "Holiday", "Non-Holiday"))

avg_sales <- transactions %>%
  group_by(Day_Type) %>%
  summarize(avg_sales = mean(sales_value, na.rm = TRUE))

ggplot(avg_sales, aes(x = Day_Type, y = avg_sales, fill = Day_Type)) +
  geom_bar(stat = "identity") +
  labs(title = "Average Sales on Holidays vs. Non-Holidays",
       x = "Day",
       y = "Average Sales") +
  theme_minimal()

This graph simply demonstrated that we do see a significant rise in average sales when nearing holidays. We believe it might be beneficial to looking more into promotions, store hours, and demand.

Now we will analyze Regorks total sales trends and how they vary throughout the year. This graph should show us how sales trend thoughout the year and the holidays while also giving us the oppurtunity to explore more unrelated unique trends that we might see.

sales_trend <- transactions %>%
  group_by(date) %>%
  summarise(total_sales = sum(sales_value, na.rm = TRUE))

ggplot(sales_trend, aes(x = date, y = total_sales)) +
  geom_line(color = "blue") +
  geom_smooth(method = "loess", color = "red") +
  labs(title = "Daily Sales Over 2017",
       x = "Months",
       y = "Total Sales") +
  theme_light()
## `geom_smooth()` using formula = 'y ~ x'

As we are seeing in the chart above, the blue line represents the daily sales trends while the red line gives us a better idea on how the total sales are changing over the year. We see a steady increase from January all the way until nearing the end of summer where sales start to decline slightly. All before rapidly trending up as the year starts ending and some of the biggest major holidays are coming. This could be used to find optimal pricing and demand for significant spikes and drops in sales on individual days. Also, by utilizing how we should be planning marketing campaigns.

Next we decided too look at how Regorks total sales varied by month. We believe this could help organize careful planning on when and how Regork should prepare for an upcoming holiday.

monthly_sales <- transactions %>%
  mutate(Month = month(date, label = TRUE)) %>%
  group_by(Month) %>%
  summarise(total_sales = sum(sales_value, na.rm = TRUE))

ggplot(monthly_sales, aes(x = Month, y = total_sales, fill = Month)) +
  geom_bar(stat = "identity") +
  labs(title = "Total Sales by Each Month in 2017",
       x = "Months",
       y = "Total Sales") +
  theme_minimal()

The final graph, similar to the second, shows how the total sales vary by the month. We clearly see which months tend to have higher total sales. As expected, December has the highest with customers getting ready to celebrate Christmas, Thanksgiving as well as many other religious holidays that take place in this month. This graph is a greatway to see how Regork can plan accordingly based on how each individual month does in sales.

Report Summary

Summarize the problem statement you addressed

The problem we addressed for the Regork company was, “Are there seasonal or holiday based spikes in product demand that we can capitalize on with targeting campaigns?” The way we addressed this problem was to dive into three different analysis we thought would be most important when trying to answer our question.

Summarize how you addressed this problem statement

The three analysis we looked into were holiday vs non-holiday sales, daily sales trends, and sales by each month.

Summarize the interesting insights that your analysis provided. What should you propose to the Regork CEO?

Some interesting insights we found with each of these analysis were that there was a higher average of sales during the holidays throughout the entire year. Our daily sales graph also showed us that there were major spikes around Christmas and New Years as well as another spike around the 4th of July. Lastly we found that May, July, and December all had the most sales per month due to the holidays of Christmas, 4th of July, and Memorial Day all coming in those months. Our biggest proposal to the Regork CEO would be to be more aggressive in marketing campaigns around the holidays, specifically Christmas and New Years as well as the 4th of July and Memorial Day.

Discuss the limitations of your analysis and how you, or someone else, could improve or build on it

Some limitations we faced would be external factors like weather patterns or industry shifts. We also do not know each and every sale that was being run at Regork. I believe one thing we could do to improve on this would be to get a day by day breakdown throughout the entire year for sales, coupons, external factors, etc.