Average user's field count

I need to know if the count of a “user” type field of a user is higher or lower than the average of the other users
Could someone help me?

Hi there, @quidsicurezza… I’m not sure if I understand your post, but it sounds to me like you might want to store the count for each user somewhere (maybe in a field on the User data type) because that should make it much easier to do what you described. If you had a count field, an expression such as the following should do the trick.

count

Anyway, just some food for thought there, and I hope it helps.

Best…
Mike

1 Like

@mikeloc, I believe @quidsicurezza wants to count the number of items in some list type field, which vanilla Bubble has no expression for.

I talk about this and show a feature of Floppy that enables this sort of comparison in this video:

1 Like

I have to average the count of a field list of all users, for example: how many friends does each facebook’s user have on average?

I guess I’m still not getting it because it still seems to me like you could store the count somewhere and do what I showed. Did you check out Keith’s suggestion? Can you share some screenshots of the relevant data type(s)/field(s)?


Maybe this is the right way, this custom state contains (I think, because I don’t know where to find the “average” fuction that you shwed me) the average number of fan of every user.
Right?

You said you are trying to compare a particular user’s fan count to the average fan count of the rest of the users. If you want to make your life easier, you could have a field on the User data type called fan count, and that field would always hold the count of a user’s fan list. With that field in place, you would be able to do exactly what I showed you.

Thanks, I wanted to have a quicker solution without having to add a field to the user, I thought it was possible

In my opinion, the “quicker” solution is the added field, but others (including yourself) may disagree, of course, at which point you can look into using Keith’s plugin or try to construct a more complicated expression that meets the need.

An average can be calculated in different ways, a mean, median and mode. Let’s assume you have 3 users and they have facebook friends like this;

User 1 = 3 friends
User 2 = 9 friends
User 3 = 20 friends

Total friends = 32

So you calculate the average by taking 32 / 3 = 10.6

I think if you add a field as @mikeloc suggested with data type called friend count then that may make the calculation easier. I guess the expression would look something like;

Do a search for friend count :count / number of users = average

Without me trying it I can’t be sure what the expressions will be but I think that is basically how you would get the average.

This topic was automatically closed after 70 days. New replies are no longer allowed.