The trend in customer's shopping pattern keeps on changing over the year. It is beneficial to understand during which period certain customers return, or certain products are sold more, or if there is a peak in business. These factors can help in designing suitable campaigns. 

The Seasonality Trend Analysis (STA) notebook is used to see how different factors and KPIs of a brand differ over the seasons (months) based on the customers who have shopped during that period.

Following factors are used in this notebook to check seasonality of a brand. 

  1. Customer's Recency
  2. Frequency (One timers and Repeaters)
  3.  RFM segment
  4. Advanced customer segment 
  5. Quantity of Product sold 

Notebook sections

The following table provides five different sections of the Notebook.

S.No.SectionCommand Line
1All KPIs on a monthly basis throughout the defined period

Cmd lines  7 - 13

Output - Cmd 13

2Recency and Frequency based customer distribution

Cmd lines 14-22

Output - Cmd 20,22

3RFM based customer distribution (using external RFM table)

Cmd lines 23-27

Output- Cmd 27

4Advanced Segments based customer distribution (using external Advanced Segments table)

Cmd lines 28-31

Output- Cmd 31

5Product Department wise customer distribution

Cmd lines  32-35

Output: Cmd 35


Understanding output

For point 1, the output will be in the form of a table with KPI values in the rows and Month in the columns.

 For points 2-5, the output will be in the form of a table with Dimension in rows and Month in columns. The values are the count of the customers converted into percentage column-wise, and each column sums up to 100. The conditional formatting is done row-wise to showcase the best performing month for a particular dimension.

Input parameters

You need to provide the following details before running the Notebook.


Input Param

Description

Org_id 

Id of the brand

Start Date 

End Date

STA notebook’s running duration. Format: YYYY-MM-DD (choose dates including RFM and Advanced Segments data if required).

RFM Database

Name of the database where the external RFM table is stored.

RFM Tablename

Name of external RFM table.

RFM User_id Column

Column name which would be joined with bill_summary on dim_event_user_id

RFM Frequency Column

Column name which has the Customer’s Frequency type as values (Example: One Timer, Repeater).

RFM Final Segment Column

Column name which has the RFM segment (Example of values inside column: Top, Mid, Base).

Advanced Segments Database

Name of the database where the external Advanced Segments table is stored.

Advanced Segments Tablename

Name of external Advanced Segments table.

Advanced Segments User_id Column

Column name which would be joined with bill_summary on dim_event_user_id

Advanced Segment Column

Column name which has the Advanced Customer type segment (Example: Crown, Premium).

Product Database

Name of the database where product table is stored (Examples: read_api_ORGID, some_external_db)

Product Table Name

Name of the table containing the product data (Examples: inventory_items, some_external_table)

Product Item Code

Column name which would be joined with bill_lineitems on item_code

Product Category

Column name with the product category.


You can see the final output in the Seasonality Trend Analysis dashboard. Download the output for the monthly KPI from Cmd 13.

Notebook Links

Open your cluster-specific link provided for the Notebook.

NotebooksCluster links
Seasonality analysisIndia  SEA
EMEA