Last active
          March 6, 2018 09:36 
        
      - 
      
 - 
        
Save RedaAffane/7577dd2b67de9d4bb544702cedcadeb0 to your computer and use it in GitHub Desktop.  
    Compute the worth of each coalition
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | SELECT "channels_subset", | |
| sum("conversion") as "conversions_sum" | |
| FROM | |
| ( | |
| SELECT "user_id", | |
| string_agg(DISTINCT("channel"), ',') as "channels_subset", | |
| max("conversion") as "conversion" | |
| FROM | |
| ( | |
| SELECT "user_id", | |
| "channel", | |
| "conversion" | |
| FROM "MARKETINGATTRIBUTIONSIMULATIONS_simulated_data" | |
| ORDER BY | |
| "user_id", | |
| "channel" | |
| )a | |
| group by "user_id" | |
| )b | |
| GROUP BY "channels_subset" | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment