Skip to main content

Find Customer Lifetime Value (LTV)

MediumPremium

You are given the following tables:

attribution table:

session_idmarketing_channelpurchase_value
stringstringfloat

user_sessions table:

session_idad_click_timestampuser_id
stringdatetimestring

Find the customer lifetime value (LTV) for each user and order the results from most valuable customer to least valuable. Your output should contain the following columns: user_id, LTV

You can find the customer lifetime value of a user by taking the sum of all the purchases made by that user