Finding the most trending series'

#1

Hi, i have recored the number of people playing games over time and trying to find the games trending in the last 7 days.

I have been trying things like:
SELECT cumulative_sum(NON_NEGATIVE_DERIVATIVE(last("player_count"))) FROM "GameDB"."alltime"."apps" WHERE time > now() - 7d GROUP BY time(1h), "app_id" ORDER BY time DESC LIMIT 1 SLIMIT 1000
to get the sum of changes between buckets, but didn’t end up giving me what i wanted.

Also tried this but couldnt get it to work.

Is there a standard method of doing this or a function that may help? Thanks.

#2

Hi ,
I think you can use the top() function in Kapacitor ?
This example can point you in the right direction :slight_smile:
Live leaderboard of game scores

#3

Thanks, i forgot to mention i am not using Kapacitor, just querying InfluxDB from a website. Hope i havent posted this in the wrong forum?