Hi my fellow community members i am trying to see ...
# questions
p
Hi my fellow community members i am trying to see example how many unique song before actually buying a subscription in a single session how can i do that, i was doing comparison of user properties with event property, don't know how to compare two event properties does someone has an idea on how they would modify this
Copy code
function main() {
  return join(
    People(),
    Events({
      from_date: "2022-11-01",  
      to_date: "2022-12-15",
      event_selectors: [{event: "purchase"}]
    })
  ).filter(function(tuple) {
    return tuple.event && tuple.user && tuple.event.name && tuple.user.properties.date_joined > tuple.event.time 
      // can also add filter for where username or email are null
  }).map(function (obj) {
    return {
      "Username": obj.user.properties.$username,
      "Current URL": obj.event.properties.$current_url, 
      "Event": obj.event.name,
      "Date Joined": obj.user.properties.date_joined,
      "Email": obj.user.properties.$email,
      "Date": obj.event.properties.$time
    }
  })
}