Hi there!
I want to add a filter to my JQL query below, to pull only users where the Frist_seen property is undefined. So far it looks like I’m getting all users, event when the property has a value (a timestamp).
Can anyone help me see what need to fix?
Thanks!
function main() {
//Get today's date
var today = new Date ( (new
Date())).toISOString().split('T')[0];
return join(
Events({
from_date: '2020-03-01',
to_date: today,
}), People())
groupByUser([user.properties.First_Seen]),
{type:'left'}
.filter(function(user){return user.properties.First_Seen === undefined})
.groupByUser(
mixpanel.reducer.min('event.time'))
.map(function(row){ return {
"id": row.key[0], //key 0 is the distinct_id name
"First_Seen": new Date(row.value).toISOString()
}}
)
}
Best answer by glencwillis
To clarify, when you’re doing a INNER join(), both events and the user profile must exist*