Is there a function or a way to do LEAD & LAG in Google Big Query SQL to predict new customer, recurring customers, and churned customers?
My Table
Order_ID | Date_Start | Date_End |
001 | 2020-1-1 | 2020-2-1 |
001 | 2020-2-1 | 2020-3-1 |
001 | 2020-3-1 | 2020-4-1 |
Expected Output:
Order_ID | Date_Start | Date_End | Churn_Status
001 | 2020-1-1 | 2020-2-1 | New Customer
001 | 2020-2-1 | 2020-3-1 | Recurring
001 | 2020-3-1 | 2020-4-1 | Churned
Thanks. Any help you be useful.