Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-73706

Report "Count distinct" aggregation incorrect for column with multiple fields

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0
    • 4.0
    • Report builder
    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • Hide
      1. Log in as admin
      2. Create three new users
        • Lionel Smith
        • Lionel Jones
        • Lionel Smith
      3. Navigate to Reports > Report builder > Custom reports in site administration
      4. Create a new report from the Users report source
        • Ensure Include default setup is unchecked
      5. In the report editor, add the Users > Full name column
      6. Open Conditions
      7. Add User > First name condition for Is equal to: Lionel (for convenience)
      8. Set Full name column aggregation to Comma separated values
      9. Confirm report row shows the following:

        Lionel Jones, Lionel Smith, Lionel Smith
        

      10. Set Full name column aggregation to Comma separated distinct values
      11. Confirm report row shows the following:

        Lionel Jones, Lionel Smith
        

      12. Set Full name column aggregation to Count
      13. Confirm report row shows the following:

        3
        

      14. Set Full name column aggregation to Count distinct
      15. Confirm report row shows the following:

        2
        

      Show
      Log in as admin Create three new users Lionel Smith Lionel Jones Lionel Smith Navigate to Reports > Report builder > Custom reports in site administration Create a new report from the Users report source Ensure Include default setup is unchecked In the report editor, add the Users > Full name column Open Conditions Add User > First name condition for Is equal to: Lionel (for convenience) Set Full name column aggregation to Comma separated values Confirm report row shows the following: Lionel Jones, Lionel Smith, Lionel Smith Set Full name column aggregation to Comma separated distinct values Confirm report row shows the following: Lionel Jones, Lionel Smith Set Full name column aggregation to Count Confirm report row shows the following: 3 Set Full name column aggregation to Count distinct Confirm report row shows the following: 2

    Description

      Assume you have two users with the following names:

      1. User One
      2. User Two

      & you create a report containing the User > Fullname column, aggregated by Count distinct

      You should receive the value 2, because there are two distinct fullnames

      What you receive is the value 1, because the aggregation type only considers the first column field (in this case the user firstname) and there is only one distinct firstname

      Attachments

        Issue Links

          Activity

            People

              pholden Paul Holden
              pholden Paul Holden
              David Matamoros David Matamoros
              Ilya Tregubov Ilya Tregubov
              Amaia Anabitarte Amaia Anabitarte
              Carlos Castillo, David Matamoros, Mikel Martín Corrales, Paul Holden
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                19/Apr/22

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 40 minutes
                  1h 40m