Skip to content

Commit 3bd197c

Browse files
committed
Group by CreatedBy as well
1 parent 7bd2939 commit 3bd197c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

query/src/org/labkey/query/persist/QueryManager.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,10 +1119,11 @@ private static Map<String, Object> getExportTypeCountsMetric()
11191119
// This is an approximation of the multi-tab export count. We record an audit log for each tab, and
11201120
// they are all likely to have the same timestamp. Not exact, but perhaps good enough for current purposes.
11211121
sql = new SQLFragment("SELECT COUNT(*) FROM (SELECT *\n" +
1122-
" FROM (SELECT COUNT(*) as count, DATE_TRUNC('second', Created) as created\n" +
1122+
" FROM (SELECT COUNT(*) as count, DATE_TRUNC('second', Created) as created, CreatedBy\n" +
11231123
" FROM ").append(table, "t").append("\n" +
11241124
" WHERE comment = 'Exported to Excel'\n" +
1125-
" GROUP BY DATE_TRUNC('second', created)\n" +
1125+
" AND CreatedBy IS NOT NULL\n" +
1126+
" GROUP BY CreatedBy, DATE_TRUNC('second', created)\n" +
11261127
" ) AS subquery\n" +
11271128
" WHERE subquery.count > 1)");
11281129
counts.put("Excel multi-tab", new SqlSelector(dbSchema, sql)

0 commit comments

Comments
 (0)