Greetings!
I'm trying to find a solution in Tabluea equivalent to this sql statements:
first_value(CUSTOMER_STATUS) over(partition by CUSTOMER_ID order by ORDER_DATE asc) as INITIAL_CUST_SEGMENT
so my output would look like:
customer_idorder_datecustomer_statusinitial_cust_status234/1/2018newnew234/3/2018returningnew235/2/2018returningnew235/8/2018returningnew652/8/2018lapsedlapsed656/5/2018returninglapsed657/1/2018returninglapsed657/5/2018returninglapsed658/1/2018returninglapsed
My trouble is getting the discrete variable of customer value once i have the min(order_date), which I assume I can get using {fixed customer_id, order_date: min(order_date)} (i will have order_date filter applied).
Attached is a super simple example of what my data looks like.
Thanks in advanced!
2 answers