View source: R/cdr_join_tbls.R
cdr_join_tbls | R Documentation |
Join data from db_tbl and recent change values from chg_log tables. Attaches most recent 'WHO_EDITED' and 'WHEN_EDITED' form deltas table to primary table.
cdr_join_tbls(db_tbl, chg_log_tbl, key_col)
db_tbl |
primary table from DB |
chg_log_tbl |
deltas table from DB |
key_col |
the name of the unique ID column in the primary table |
tibble of the joined tables
chg_log_r_tbl <- structure(
list(
OBS_ID = c( "ID-001", "ID-002"),
FIELD = c("Species", "Sepal.Width"),
CHG_FROM = c("setosa", "3.5"),
CHG_TO = c("set", "5"),
WHO_EDITED = c("joe", "fred"),
WHEN_EDITED = c("11/29/2023, 1:36:46 AM", "11/28/2023, 5:39:21 PM")
),
class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, -2L)
)
primary_r_tbl <- cdr_make_unique_ids(iris)
cdr_join_tbls(primary_r_tbl, chg_log_r_tbl, key_col = 'UID')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.