9

Here's a screen capture from a site where I can view /site-analytics:

broken plot

The orange "all posts" curve should be strictly larger than the blue "questions" curve, but they are mistakenly displaying the same data.

  • Yup... I see this here on MSE, too. Wonder what happened there. – Catija Dec 28 '18 at 17:06
  • A guess: an SQL typo which left a where PostType = "question" in the wrong place. – rob Dec 28 '18 at 17:08
5

This is now fixed. The root cause was something like this:

AllPostsDatapoints.Add( questionDatapoint?.Value ?? 0 + answerDatapoint?.Value ?? 0 )

The intent here is to sum the question and answer counts for a given date, allowing for the possibility that either or both might be null (no questions or answers for that day). But... The null coalescing operator has lower precedence than the addition operator, so what the expression actually evaluates to is... The question count, unless there were no questions, in which case it evaluates to the answer count.

I'm not normally a big fan of junking up expressions with lots of parentheses, but in this case that's the only way it really works:

AllPostsDatapoints.Add( (questionDatapoint?.Value ?? 0) + (answerDatapoint?.Value ?? 0) )

Thanks for reporting this!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .