We are trying to record the average user preferences in the mobile app.
Is there a way to use average/count/percentage … with only the latest event sent by a user?
Problem is that the record event function records events per session, so if a user is using the app 5 times a day, his preferences are being counted 5 times more.
user1 -> notificationMinutes = 10
user2 -> notificationMinutes = 4
user1 logs in 5 times, user2 only 1 time -> average I get is 9 => ( 5*10 + 4 ) / 6 = 9 and it should have been 7 => (10+4) / 2 = 7
Queries we have tried
This one brings the latest values, but I don’t manage to put them together because of the
FACET uuid and it’s not useful to see the value user per user
SELECT latest(notificationMinutes) FROM Mobile, CallInEvent FACET uuid SINCE '2017-12-05' WHERE appName='Prep-iOS' and name='userPreferences'
This one brings the average, but it’s a wrong one, taking into account all the sessions recorded (more than one time per user) and it’s not useful to see data that is not accurate
SELECT average(notificationMinutes) FROM CallInEvent SINCE this quarter WHERE appName='Prep-iOS' and name = 'userPreferences'
If this is not possible, how would you approach this problem then? How do you record static things in the app that don’t change per session, but just change from time to time?
Thanks a lot for your help