1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Design Issue Weekly & Monthly User activity stats

Discussion in 'Resolved Bug Reports' started by Crazy-Achmet, Mar 3, 2014.

  1. Crazy-Achmet

    Crazy-Achmet Active 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

    Xon likes this.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    The weekly and monthly stat's are cumulative daily totals, not averages.
  3. Crazy-Achmet

    Crazy-Achmet Active Member

    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. ;)
  4. Mike

    Mike XenForo Developer Staff Member

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

    RobParker Well-Known Member

    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).
  6. jeffwidman

    jeffwidman Active Member

    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:
    SELECT COUNT(user_id) FROM xf_user WHERE last_activity >= [1st of the month] AND last_activity < [1st of next month]
  7. Crazy-Achmet

    Crazy-Achmet Active Member

    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 ;)
    RobParker likes this.
  8. jeffwidman

    jeffwidman Active Member

    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.
  9. Joe Link

    Joe Link Well-Known Member

    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?
  10. RDR

    RDR Well-Known Member

    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.
    Joe Link likes this.

Share This Page