dbr.avg including NULLs in aggregate

(5 posts) (2 voices)
  1. nsepetys, Member

    Hello,

    I am attempting to use the dbr.avg function but the average I am getting does not equal the value I am expecting. The average value for my columns are including NULL values thus reducing the total of the average shown on myDBR report. I would rather not post our myDBR report but if someone can replicate this issue it would be much appreciated.

    I read in this posting ( http://mydbr.com/forums/topic.php?id=1052#post-3176 ) that myDBR does not include NULLs but I am not seeing that. I am using myDBR version 4.3.0. Any help would be appreciated.

    Thanks!

  2. myDBR Team, Key Master

    Hi,
    myDBR does not include NULL's into aggregate calculation. You can test this with simple report:

    select 'dbr.avg', 'value';
    
    select 'First' as 'Name', 1 as 'value'
    union
    select 'Second', null
    union
    select 'Third', 5;

    This should give you average of 3 (two rows with values total of 6 = average is 3).

    If you still have a problem with your own report (check that NULLs are really NULLs), add '&export=sql' to the URL and send the report output to support email (if you need you can change the data).

    --
    myDBR Team

  3. nsepetys, Member

    I just ran your example and I got an average of 2. You have any ideas as to what might be causing this issue for just our instance?

  4. myDBR Team, Key Master

    You could just run the updater first to update to latest version (4.3.3).

    --
    myDBR Team

  5. nsepetys, Member

    The myDBR update was run over this last weekend and the average bug has been resolved. NULLs are no longer included in the average calculation. Thank you to the Key Master for providing this solution.


Reply

You must log in to post.