open_in_new
content_copy
dt_pivot <- dt[, .( n = data.table::uniqueN(id[filter > 0]) ), by = group_col ]