Description Usage Arguments Examples
Generate changes for a Slowly changing dimension type 2 (Add new rows)
1 2 | dwh_update_scd_type2(current_dim, new_data, surrogate_key, natural_keys,
scd_date = Sys.Date())
|
current_dim |
Current table, if a reference to a table in DWH, will download the entire table into R |
new_data |
The data you want to insert into the dimension |
surrogate_key |
The surrogate key you want to use, it has to be an integer column, and it has to be the first column in the table |
natural_keys |
The natural keys to use for joining the old data with the new data |
scd_date |
The date to insert, defaults to the current date |
1 2 3 4 5 6 7 8 | ## Not run:
cur_dim = dwh_query('select * from prod.dim_my_dimension')
new_data = mutate(cur_dim, bla=1)
changes = dwh_update_scd_type2(cur_dim, new_data, dim_key, c('business_key', 'business_key2'))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.