dwh_update_scd_type1: SCD Type 1

Description Usage Arguments Examples

View source: R/scd_etl.R

Description

Generate changes for a Slowly changing dimension type 1 (Overwrite values)

Usage

1
dwh_update_scd_type1(current_dim, new_data, surrogate_key, natural_keys)

Arguments

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

Examples

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_type1(cur_dim, new_data, dim_key, c('business_key', 'business_key2'))


## End(Not run)

auth0/rauth0 documentation built on July 3, 2021, 4:11 p.m.