diff --git a/R/class-workbook.R b/R/class-workbook.R index 1ecdfe483..ec9e57585 100644 --- a/R/class-workbook.R +++ b/R/class-workbook.R @@ -1522,7 +1522,7 @@ wbWorkbook <- R6::R6Class( sel <- which(pt$name == pivot_table) cid <- pt$cacheId[sel] - uni_name <- paste0(slicer, cid) + uni_name <- paste0(stringi::stri_replace_all_fixed(slicer, ' ', '_'), cid) ### slicer_cache sortOrder <- NULL diff --git a/R/helper-functions.R b/R/helper-functions.R index c0662131a..d643a1357 100644 --- a/R/helper-functions.R +++ b/R/helper-functions.R @@ -654,6 +654,8 @@ get_items <- function(data, x, item_order, slicer = FALSE, choose = NULL) { if (is.null(item_order)) { item_order <- order(dat) + } else if (is.character(item_order)) { + item_order <- match(dat, item_order) } if (!is.null(choose)) {