


#  USE trackid, NOT isrc  (some isrcs have more than one track associated to them)

release & albumname   are the same  (but off)
artist  & artistname  are the same  (but off)

cols <- 
c( "download_date", "upc", "trackid",  "mobile", 
    "artist", "albumname",  
    "genre", 
    "product", 


    "userid", 
    "gender", "birthyear", 

    "user_country", "artist_country", "label_country",


    "minDate.byupc", "maxDate.byupc", 
    "mkt_priority", "label_priority", "label")


# ------------------------------------ #
#  This is for quick interactive work  #
# ------------------------------------ #
  .setDTcols(cols)
  .setDT("DB.merged")
  .D()
# ------------------------------------ #


tallycounts <- do.call(rbind, strsplit(grep("^t\\.", names(DB.raw), value=TRUE), "\\.by|^t\\."))[,-1]
tallycounts <- as.data.table(tallycounts)
setnames(tallycounts, c("count", "byc"))


