There isn't a really elegant way to make it happen, but for a given userId
you could successfully return your the most up-to-date event create a count
query with a group_by
on [surveyScore, keen.timestamp] and an order_by
on the keen.timestamp
property. You will want to set limit
=1 to select only the most recent surveyScore
.
If you'd like to use an extraction, the most straight forward way would be to run an extraction with property_names
set to ["userId","keen.timestamp","surveyScore"]
. Once you receive the results you can then do some client-side post processing. This is probably the best way if you want to take a look at all of your userId
s.
If you're interested in a given userId
and want to use an extraction
, you can run an extraction with a filter on the userId eq X
, define the optional parameter latest
set to latest=1
. The latest
property is an integer containing the number of most recent events to extract. Note: The use of latest
will call upon the keen.created_at
timestamp instead of keen.timestamp
(https://keen.io/docs/api/#the-keen-object).