Without access to change data directly in the database, the only means of changing data is to resubmit a zeroed out version of the original submission. This function replaces any cell with entered data with zero so that it can be resubmitted and processed by Trifacta. The original, correct version should be re-processed after the zeroed dataset has been processes

hfr_rectify_date(subm_file, subm_tab, folderpath_templates = "templates/")

Arguments

subm_file

submission file with incorrect dates

subm_tab

tab with incorrect dates

folderpath_templates

folder path where current HFR templates are located

Value

exports two files - one with zeroed out data for wrong date and one with corrected date

Examples

if (FALSE) {
#store file paths for looping over to read in
  df_files_tabs <- list.files(folderpath, full.names = TRUE) %>%
    purrr::map_dfr(~ tibble::tibble(file = .x,
                                    tabs = readxl::excel_sheets(.x))) %>%
    dplyr::filter(stringr::str_detect(tabs, "HFR"))
#fix date and create zeroed version for wrong date (to clean from DB)
 pwalk(df_files_tabs, ~hfr_rectify_date(..1, ..2)) }