Master a small skill in 3 minutes: analysis of repeat customers

 This article is published by NetEase Cloud 


Author: Wang Qian (This article is only for internal sharing in Zhihu. If you need to reprint, please obtain the author's consent and authorization.)


For a business to operate well, it must be able to retain customers, and ideally every customer can become a repeat customer. This article will introduce how to use NetEase Youshu 's recently launched "Cross View Granularity Calculation" to analyze repeat customers.


Put a few example pictures first.

Example 1: Monthly distribution of the first repurchase interval. For example, the column pointed to by the arrow indicates "50 customers placed an order after the first order was placed 6 months later".


Example 2: Quarterly analysis of repurchase interval, for example, the square pointed to by the arrow means "among the new customers in the third quarter of 2013, 35 people placed an order after a one-quarter interval".



Example 3: Analysis of the repurchase rate of each product, for example, when entering "1", we can see the proportion of customers who place an order again within 1 month after the first order is placed for each product.


As shown in the figure, in our test data ( download data ), there is only the time when the customer places an order each time, and there is no data such as the customer's "first order date", "first repurchase date", "first repurchase interval", etc. So how to implement the analysis of the above example.


This requires the use of NetEase's "Cross-view granularity calculation" function. The following will introduce step by step how to calculate the customer's "first order date", "first repurchase date" and "first repurchase interval" in the data. time" etc.


In the first step, we create a calculated field for "First Order Date". The grammar rules are as follows:


{ FIXED [customer name] : MIN([order date]) }

What it means is, calculate the minimum date of each customer's order date, that is, the first order date. As shown in the figure, we can view the result of the calculated field.

The second step, now that we have the date of the first order, how to calculate the date of the second order, we can create a calculation field of "date of first repurchase", the syntax is as follows:


{ FIXED [customer name] : min(if [order date] > [first order date] then [order date] )}

It means to calculate the date of each customer's first repurchase (that is, the second order), as shown in the figure, you can view the calculation results.


第三步,如此一来,得到了客户首次下单的日期跟第二次下单的日期,我们便可以计算两个日期的间隔时间。再创建一个“首次复购间隔时间”的计算字段,语法如下:


DATEDIFF("month", [首次下单日期], [首次复购日期])


该字段计算的是两个日期相隔了多少个月,如果想计算相隔的天数、季度数可以将语法中的"month"改为"day"或者"quarter"。

至此我们便得到了需要的数据,基于这些数据,我们可以实现上述三个示例的分析,由于篇幅有限,本文不展开示例实现的具体操作步骤,如果读者有兴趣可以在评论区留言索要具体的操作步骤演示。


文中所有示例均是在网易有数中实现,欢迎使用体验~


了解 网易云

网易云官网:https://www.163yun.com/

新用户大礼包:https://www.163yun.com/gift

网易云社区:https://sq.163yun.com/


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325678617&siteId=291194637