Introduction

Business Problem

The objective is to optimize snack sales for Regork by strategically utilizing coupons, with a particular focus on understanding the seasonal influences on consumer purchasing behavior.

How I Adressed the Problem

To address this issue, I conducted a detailed analysis of transaction, product, and coupon data. I focused on the top and bottom three selling snack items to provide a comprehensive view of snack performance across different sales categories. For the bottom three, I used a minimum threshold of 1,200 total sales to ensure meaningful comparisons of coupon effectiveness. This approach allowed me to clearly identify patterns in coupon usage and pinpoint the times of year when snack items achieve peak sales.

Packages Required:

completejourney: Access to retail consumer data

tidyverse: A set of tools for data analysis

lubridate: Makes working with dates easier

ggplot2: Creates visual charts and graphs

dplyr: Simplifies data manipulation

gridExtra: Combines multiple plots

DT: Creates interactive tables

Part 2: Percentage of Coupon vs Non Coupon Sales

How I Dissected the Data

To analyze this, I divided the data into two main categories: coupon sales and non-coupon sales. I then converted these totals into percentages to provide a clearer representation of the trends. Finally, I created several graphs to present the findings in a more visually appealing format.

# Calculate total sales and percentage breakdown for top 3 snack types
top_3_sales_summary <- transactions_coupons %>%
  filter(product_type %in% top_3_types$product_type) %>%
  group_by(product_type, coupon_used) %>%
  summarise(total_sales = sum(sales_value)) %>%
  mutate(
    percentage_of_total = total_sales / sum(total_sales) * 100,
    coupon_status = ifelse(coupon_used, "Coupon Sales", "Non-Coupon Sales")
  ) %>%
  ungroup()
datatable(head(top_3_sales_summary), options = list(pageLength = 6))
# Calculate total sales and percentage breakdown for bottom 3 snack types
bottom_3_sales_summary <- transactions_coupons %>%
  filter(product_type %in% bottom_3_types$product_type) %>%
  group_by(product_type, coupon_used) %>%
  summarise(total_sales = sum(sales_value)) %>%
  mutate(
    percentage_of_total = total_sales / sum(total_sales) * 100,
    coupon_status = ifelse(coupon_used, "Coupon Sales", "Non-Coupon Sales")
  ) %>%
  ungroup()
datatable(head(bottom_3_sales_summary), options = list(pageLength = 6))
# Calculate the overall coupon usage percentage for all snack items
overall_coupon_percentage <- transactions_coupons %>%
  group_by(coupon_used) %>%
  summarise(total_sales = sum(sales_value)) %>%
  ungroup() %>%
  mutate(
    percentage_of_total = total_sales / sum(total_sales) * 100,
    coupon_status = ifelse(coupon_used, "Coupon Sales", "Non-Coupon Sales")
  )
datatable(head(overall_coupon_percentage), options = list(pageLength = 2))
# Create pie charts for the Top 3 snack product types using percentages
top_3_pie_plot <- ggplot(top_3_sales_summary, aes(x = "", y = percentage_of_total, fill = coupon_status)) +
  geom_bar(stat = "identity", width = 1) +
  coord_polar("y") +
  facet_wrap(~ product_type) +
  geom_text(aes(label = paste0(round(percentage_of_total, 1), "%")), 
            position = position_stack(vjust = 0.5), size = 8) + 
  labs(
    title = "Coupon vs. Non-Coupon Sales for Top 3 Snack Product Types",
    x = "",
    y = "Percentage of Total Sales",
    fill = "Sales Type"
  ) +
  scale_fill_manual(values = c("Coupon Sales" = "#2BBBD4", "Non-Coupon Sales" = "#D4442B")) +
  theme_minimal() +
  theme(
    plot.title = element_text(size = 20, face = "bold", hjust = 0.5), 
    axis.title = element_blank(),
    axis.text.x = element_blank(),
    axis.text.y = element_text(size = 14),  
    axis.ticks = element_blank(),
    strip.text = element_text(size = 16, face = "bold"), 
    legend.title = element_text(size = 14),
    legend.text = element_text(size = 12)
  )

# Create pie charts for the Bottom 3 snack product types using percentages
bottom_3_pie_plot <- ggplot(bottom_3_sales_summary, aes(x = "", y = percentage_of_total, fill = coupon_status)) +
  geom_bar(stat = "identity", width = 1) +
  coord_polar("y") +
  facet_wrap(~ product_type) +
  geom_text(aes(label = paste0(round(percentage_of_total, 1), "%")), 
            position = position_stack(vjust = 0.5), size = 8) +  
  labs(
    title = "Coupon vs. Non-Coupon Sales for Bottom 3 Snack Product Types",
    x = "",
    y = "Percentage of Total Sales",
    fill = "Sales Type"
  ) +
  scale_fill_manual(values = c("Coupon Sales" = "#2BBBD4", "Non-Coupon Sales" = "#D4442B")) +
  theme_minimal() +
  theme(
    plot.title = element_text(size = 20, face = "bold", hjust = 0.5),  
    axis.title = element_blank(),
    axis.text.x = element_blank(),
    axis.text.y = element_text(size = 14),  
    axis.ticks = element_blank(),
    strip.text = element_text(size = 16, face = "bold"),  
    legend.title = element_text(size = 14),
    legend.text = element_text(size = 12)
  )

# Create a pie chart for Overall Coupon Usage Percentage using total percentages
overall_pie_plot <- ggplot(overall_coupon_percentage, aes(x = "", y = percentage_of_total, fill = coupon_status)) +
  geom_bar(stat = "identity", width = 1) +
  coord_polar("y") +
  geom_text(aes(label = paste0(round(percentage_of_total, 1), "%")), 
            position = position_stack(vjust = 0.5), size = 8) +  
  labs(
    title = "Overall Coupon vs. Non-Coupon Sales",
    x = "",
    y = "Percentage of Total Sales",
    fill = "Sales Type"
  ) +
  scale_fill_manual(values = c("Coupon Sales" = "#2BBBD4", "Non-Coupon Sales" = "#D4442B")) +
  theme_minimal() +
  theme(
    plot.title = element_text(size = 20, face = "bold", hjust = 0.5),  
    axis.title = element_blank(),
    axis.text.x = element_blank(),
    axis.text.y = element_text(size = 14), 
    axis.ticks = element_blank(),
    legend.title = element_text(size = 14),
    legend.text = element_text(size = 12)
  )

# Display all pie charts together
grid.arrange(top_3_pie_plot, bottom_3_pie_plot, overall_pie_plot, ncol = 1)

Analysis Based on the Graphs

These graphs clearly show that the majority of snack sales are driven by coupon use, with over 75% of total sales coming from discounted purchases. This highlights the critical role coupons play in driving snack sales for Regork. Understanding which products are highly dependent on coupons versus those that sell well without them will help Regork better prioritize its coupon distribution strategy. This insight allows them to focus on the products that benefit the most from promotional efforts and adjust accordingly.

Part 3: Coupon Usage

How I Dissected the Data

For my final step in solving this problem, I analyzed the data to determine how many coupons were actually used for each of the six snack items. I categorized the coupon data into two main groups: used and unused. To illustrate this, I created several graphs showing coupon usage for each snack type, along with an overall comparison of used versus unused coupons.

# Combined Analysis for Top 3, Bottom 3, and Overall Coupon Usage
# Calculate coupon usage for top 3 snack product types
top_3_coupon_usage <- top_3_data %>%
  group_by(product_type, coupon_used) %>%
  summarise(total_count = n()) %>%
  mutate(coupon_status = ifelse(coupon_used, "Used", "Unused")) %>%
  ungroup()

# Calculate coupon usage for bottom 3 snack product types
bottom_3_coupon_usage <- bottom_3_data %>%
  group_by(product_type, coupon_used) %>%
  summarise(total_count = n()) %>%
  mutate(coupon_status = ifelse(coupon_used, "Used", "Unused")) %>%
  ungroup()

# Calculate overall coupon usage across all products
overall_coupon_usage <- transactions_coupons %>%
  group_by(coupon_used) %>%
  summarise(total_count = n()) %>%
  mutate(coupon_status = ifelse(coupon_used, "Used", "Unused"))
datatable(head(top_3_coupon_usage), options = list(pageLength = 6))
datatable(head(bottom_3_coupon_usage), options = list(pageLength = 6))
datatable(head(overall_coupon_usage), options = list(pageLength = 2))
# Create bar plot for top 3 product types
top_3_plot <- ggplot(top_3_coupon_usage, aes(x = product_type, y = total_count, fill = coupon_status)) +
  geom_bar(stat = "identity", position = "dodge") +
  labs(
    title = "Coupon Usage for Top 3 Snack Product Types",
    x = "Product Type",
    y = "Total Count",
    fill = "Coupon Status"
  ) +
  scale_fill_manual(values = c("Used" = "#2BBBD4", "Unused" = "#D4442B")) +  
  theme_minimal() +
  theme(
    plot.title = element_text(size = 20, face = "bold", hjust = 0.5),  
    axis.title.x = element_text(size = 16, face = "bold"),  
    axis.title.y = element_text(size = 16, face = "bold"), 
    axis.text.x = element_text(size = 14, face = "bold", angle = 0, hjust = 0.5),  
    axis.text.y = element_text(size = 14),  
    legend.title = element_text(size = 14, face = "bold"),  
    legend.text = element_text(size = 12),  
    plot.margin = unit(c(1, 1, 2, 1), "cm")  
  )

# Create bar plot for bottom 3 product types
bottom_3_plot <- ggplot(bottom_3_coupon_usage, aes(x = product_type, y = total_count, fill = coupon_status)) +
  geom_bar(stat = "identity", position = "dodge") +
  labs(
    title = "Coupon Usage for Bottom 3 Snack Product Types",
    x = "Product Type",
    y = "Total Count",
    fill = "Coupon Status"
  ) +
  scale_fill_manual(values = c("Used" = "#2BBBD4", "Unused" = "#D4442B")) +  
  theme_minimal() +
  theme(
    plot.title = element_text(size = 20, face = "bold", hjust = 0.5),  
    axis.title.x = element_text(size = 16, face = "bold"), 
    axis.title.y = element_text(size = 16, face = "bold"),  
    axis.text.x = element_text(size = 14, face = "bold", angle = 0, hjust = 0.5),  
    axis.text.y = element_text(size = 14),  
    legend.title = element_text(size = 14, face = "bold"),  
    legend.text = element_text(size = 12), 
    plot.margin = unit(c(2, 1, 2, 1), "cm")  
  )

# Create bar plot for overall coupon usage
overall_plot <- ggplot(overall_coupon_usage, aes(x = coupon_status, y = total_count, fill = coupon_status)) +
  geom_bar(stat = "identity") +
  labs(
    title = "Total Counts of Used and Unused Coupons",
    x = "Coupon Status",
    y = "Total Count"
  ) +
  scale_fill_manual(values = c("Used" = "#2BBBD4", "Unused" = "#D4442B")) +  
  theme_minimal() +
  theme(
    plot.title = element_text(size = 20, face = "bold", hjust = 0.5),  
    axis.title.x = element_text(size = 16, face = "bold"),  
    axis.title.y = element_text(size = 16, face = "bold"),  
    axis.text.x = element_text(size = 14, face = "bold", angle = 0, hjust = 0.5),  
    axis.text.y = element_text(size = 14),  
    legend.title = element_text(size = 14, face = "bold"),  
    legend.text = element_text(size = 12),  
    plot.margin = unit(c(2, 1, 1, 1), "cm")  
  )


grid.arrange(
  top_3_plot,
  bottom_3_plot,
  overall_plot,
  ncol = 1,
  heights = c(1, 1, 1),
  padding = unit(2, "lines")  
)

Analysis Based on the Graphs

These graphs show that the majority of coupons distributed for these snack items were actually used, highlighting the significance of selecting the right products for coupon promotions. When most coupons are being redeemed, it indicates strong customer engagement, suggesting that Regork should continue issuing coupons for these items to maintain high sales levels. Conversely, items with a low coupon usage rate should be reevaluated to determine if adjustments are needed in the promotional strategy.

Conclusion

How My Analysis Will Help Regork

My analysis provides Regork’s CEO with actionable insights into how coupons influence snack sales across different products and time periods. By identifying that over 75% of snack sales are driven by coupon use and that July and December are peak sales months, the analysis allows the company to strategically plan coupon distributions for maximum impact. The focus on both high and low-performing items ensures that Regork can optimize its resources and enhance overall sales, thereby making informed decisions about where to invest in promotions and how to balance profitability with market growth.

Solution

To optimize snack sales, I recommend implementing a seasonal and product-focused coupon strategy. During peak months like July and December, Regork should increase coupon distribution for high-performing items to capitalize on strong demand, while using targeted promotions to boost lower-performing products. In off-peak months, a more selective coupon approach should be used, focusing on maintaining steady sales without overwhelming customers. Additionally, items highly dependent on coupons should be prioritized, while those with low coupon effectiveness should be reevaluated for alternative promotions. This strategy ensures Regork maximizes the return on its promotional investment throughout the year, driving both short-term sales and long-term growth.