Skip to content

Commit

Permalink
mag field pq: take the one at lowest position (not strictly 0)
Browse files Browse the repository at this point in the history
  • Loading branch information
f-hafner committed Sep 12, 2023
1 parent 38616c7 commit 40645eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/define_field.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ define_field <- function(tbl, conn, from, ...) {
if (from == "graduates") {
person_id <- "goid"
person_field <- dplyr::tbl(conn, "pq_fields_mag") %>%
dplyr::filter(.data$position == 0) %>%
dplyr::group_by(.data[[person_id]]) %>%
dplyr::filter(.data$position == min(.data$position)) %>%
dplyr::ungroup() %>%
dplyr::select(.data[[person_id]],
fieldname_pq = .data$fieldname,
.data$mag_field0)
Expand Down

0 comments on commit 40645eb

Please sign in to comment.