question

zdsmith avatar image
zdsmith asked

StatisticAggregationMethod not getting applied?

I'm using this code in Unity to create a new statistic, and am assigning StatisticAggregationMethod.Min. However, the statistic continues to use the "Last" item sent, and also shows as "Last" on the PlayFab dashboard. If I switch the aggregation method to "Min" on the dashboard it will stick and continue to function correctly. Any ideas??

PlayFabAdminAPI.CreatePlayerStatisticDefinition( new PlayFab.AdminModels.CreatePlayerStatisticDefinitionRequest() {

AggregationMethod = PlayFab.AdminModels.StatisticAggregationMethod.Min,

StatisticName = "Name",

VersionChangeInterval = PlayFab.AdminModels.StatisticResetIntervalOption.Never

}, result => { //It was created.. }, statsError => { Debug.Log("Could not create statistic: " + statsError.GenerateErrorReport()); });

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

·
brendan avatar image
brendan answered

Can you check that "PlayFab.AdminModels.StatisticAggregationMethod.Min" evaluates to the string "Min" in your code? If you test this API call in Postman, you'll see that it works fine with that as the input. My suspicion is that you're passing a numeric value, instead.

5 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.

zdsmith avatar image zdsmith commented ·

Looks like you're right. If I mouse over "Min" it says "Min = 1"... So is it a bug with the Unity implementation? Any options here?

0 Likes 0 ·
brendan avatar image brendan zdsmith commented ·

We've just tested with Unity here, and in our project, the value being passed in is the correct string "Min" when we use the enum. What version of Unity are you using, and what version of our SDK?

0 Likes 0 ·
zdsmith avatar image zdsmith brendan commented ·

Unity is 2017.2.0f3.. PlayFab is 2.33.171127

0 Likes 0 ·
Show more comments
zdsmith avatar image zdsmith commented ·

Yes, but not till next week. I think as a temporary fix I'll just create all the stastics and then go in and make them "Min" on the dashboard.

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.