question

vividhelix avatar image
vividhelix asked

Building a histogram?

I'm displaying a histogram of user scores in my game. I'd need a way to display some aggregates for a leaderboard without retrieving all the entries.

Any thoughts on if (and how) I could achieve this with Playfab?

I looked at the docs but couldn't find any custom querying of leaderboards or global (collective) stats.

Leaderboards and Statistics
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
JayZuo avatar image
JayZuo answered

Currently, the leaderboard system only support GetLeaderboard, GetLeaderboardAroundUser and GetFriendLeaderboard. Custom querying is not supported. I'm not sure what aggregation you are looking for, you may try with Segment with which you can filter players based on the statistics value. If this can't meet your requirement, you may use some external services to store all the leaderboard data and perform querying against it. Besides, there will be a leaderboard upgrade in upcoming Q4 features:https://blog.playfab.com/blog/upcoming-roadmap-2018-q4-oct-dec-edition which might help you. You may look forward to it.

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image brendan commented ·

Given your requirements, it sounds like your best option might be to use our Azure Data Explorer integration to pull data for custom queries you have on your data. This is something we have in preview right now, but we'll be expanding upon in the coming months.

0 Likes 0 ·
vividhelix avatar image vividhelix commented ·

I looked at the upcoming changes in the roadmap but it doesn't look like it's addressing my issue. I need to perform a "select score, count(*) group by score" or something along those lines (get number of occurrences for each score).

Where can I find more info on the Azure Data Explorer that you mention @Brendan?

0 Likes 0 ·
brendan avatar image brendan vividhelix commented ·

My apologies - it looks like it's not in public preview yet. You can expect it to show up soon, but you can read more about the Azure Data Explorer here:

https://azure.microsoft.com/en-us/services/data-explorer/

Right now, you could use the Snowflake integration to accomplish the same thing - query for the data, potentially using a local cron job, and update a data store with the aggregate info you need.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.