Design issue Weekly & Monthly User activity stats

FloV

Well-known member
Hey everybody,

i'm not sure if that's a bug or if i'm missunderstanding it. In my opinion if i have 1.000 Users active each day and those 1.000 users are the same on every day in a month at the end of the month i'm having 1.000 active users.

But the statistics page says i'm having 30.000 active users. ;)

Warm regards from Germany

Florian
 
Yeah, i know. On other stats like new threads, posts, conversations,... that would be right but not on active users. A community with 5.000 registered users should have stats with 30.000 active users. ;)
 
The system is designed around summing to get aggregate stats. This is (I think) the only stat that doesn't work that way. You would effectively need to divide but the number of days in the period.
 
You would effectively need to divide but the number of days in the period.

That's wrong isn't it?

A very simplified example:

Say you have 10 active users one day and 100 the next day. If the "month" was 2 days long, as it stands it'd return 110 as the value. Your advice is to half it to make it 55.

But in that month you've had at least 100 active unique users and potentially up to 110 unique users (assuming the 10 on day 1 didn't visit on day 2).
 
I used to run an analytics software company, and this uniques vs totals stuff was a major headache. Thankfully it's only this one metric.

Often you have to do a SELECT COUNT(DISTINCT object_id)... but in this case all you really need is:
Code:
SELECT COUNT(user_id) FROM xf_user WHERE last_activity >= [1st of the month] AND last_activity < [1st of next month]
 
It's not that easy. With that query you'll get the active users of last month, but you've no data to compare cause you can't get the active users of 2 month ago ;)
 
Unfortunately, there's no way to retroactively get unique user logins if you're looking for a query you can run right now to get past months.
If this feature is implemented, then the results at the end of each month just need to be stored for future reference. Several other stats have the same issue, that's why the rebuild stats tool explicitly includes a warning next to "delete cached data" that once deleted, some of the past data can't be regenerated.
 
Say I have a site with 10,000 users. If I wanted to see how many of those users logged in last month, how would I do that?
 
Say I have a site with 10,000 users. If I wanted to see how many of those users logged in last month, how would I do that?
ACP > Users > Search for Users

Set the "Last visited between:" to 30 days ago and leave everything else default.

Click submit and you should get a list of users and in the bottom right will be your total count.
 
I used to run an analytics software company, and this uniques vs totals stuff was a major headache. Thankfully it's only this one metric.

Often you have to do a SELECT COUNT(DISTINCT object_id)... but in this case all you really need is:
Code:
SELECT COUNT(user_id) FROM xf_user WHERE last_activity >= [1st of the month] AND last_activity < [1st of next month]

Would you please advise (a non expert php)

I want to test that either:
1. last_activity >= [1st of this month] OR
2. month within last_activity is = month of current date

Would you please show me how to construct that test?
 
Top Bottom